Find a record in a subform and open main form (1 Viewer)

Jonesy41

New member
Local time
Today, 19:20
Joined
Jul 16, 2015
Messages
4
I have a form (MainData) and a subform (MainDatsSubform).
MainData has tombstone data like name, email, phone, etc.
Subform has several tabs with various fields including a file #

When I want to search for a client based on their file#, it will find it but only open the subform.

Question: How do I search for a file number, and have it open the main form with the subform?

Thanks in advance.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:20
Joined
May 7, 2009
Messages
19,169
you need to make the Mainform Bound.
add a Unbound textbox (txtFileNum) on the main form.
add code to it's AfterUpdate event:

private sub txtFileNum_AfterUpdate()
DoCmd.SearchForRecord acActiveDataObject, , , "[File#]='" & Me!txtFileNum & "'"
end sub
 

Users who are viewing this thread

Top Bottom