Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Forms HELP!

Status
Not open for further replies.

Bickertk

Programmer
Aug 26, 2002
23
GB
I have put a query together to make a form from two tables.

One table is Names and ID Numbers the others is a list of journey numbers and destinations.

I want the lookup the names and have the other information put in automatically.

How do I make the name box a look up in the query?

Every time I put a combobox on the form and use the query as the source it only shows a text box and the other information does not change.

Can anyone help?
 
Hi

Put code like the following in the after update event of the Combo box.

Private Sub cboSupplierId_AfterUpdate()
Dim Rs As Recordset
'
Set Rs = Me.RecordsetClone
Rs.FindFirst "supplierid = '" & cboSupplierId & "'"
If Rs.NoMatch Then
Else
Me.Bookmark = Rs.Bookmark
End If
Rs.Close
Set Rs = Nothing
End Sub

In addition it sounds to me like you might be on the wrong track with your form design.

I would have thought you should have a form based on the Table containing the Names and ID, the combo box to retrieve the name/Id would be on this form.

Make another form (continuous or datasheet, based on the Journey table)

Create a subform control on the 'Name' Form (probably with NameId as the link criteria, but this is a guess, based on the info given so far), the subform control to contain the Journey Form.

Hope this helps

Regards

Ken Reay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top