Search in subform?

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
 
K

Ken Snell

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.
 
H

Henro

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
 
K

Ken Snell

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top