Search in subform?

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

I made this mainform (Client) with an subform (Visits), each based on their
own table. They're linked using the clientID.
Each Client is unique but there can be multiple visit's at one client.

Waht I want is 2 dblclick on the visitID (indexed field) and then search a
certain visit nopt necessarily belonging to that client. This is not so hard
but now I am wondering; what happens if I search a certain visitId in a
subform and that VisitID does not belong to that client? Will the Mainform
change accordingly and show the client that I visited?

Or will it search only in the subform and thus only search the visits
belonging to that client?

Any one?

Grtz Henro
 
I'm not sure I'm understanding what you're doing, but if you "move" a
subform to a client that is not the main form's client, the main form will
not move to that client. The main form is the master, the subform is the
child. To move the main form, you'll need to run code that changes the main
form's client.
 
I tried this code to go to the desired record:


Private Sub BezoekIDZoek_Click()


Dim Message, Title, Wanted
Message = "Give the visitID"
Title = "VisitID"
Wanted = InputBox(Message, Title)
DoCmd.GoToRecord , , acGoTo , Wanted

End Sub

but I don't end up at the desired record, even not if I give in the record
which is on screen at that mpment, it can't find any record at all.

Suggestions?

TIA Henro
 
Is this code in the subform of the form? Sorry, but I cannot see your form,
so you need to provide lots more details about the form and the subform, and
where the code is running, and such.
 
Back
Top