Reyesrj
asked on
VBA search in MS Access 2007 Form
Hi All,
I’m working on MS Access 2007. I have a form (Main Form) with information that is filled out by the user. What I am trying to do is make another form that opens when the user launches access (This I can do).
In the form that opens at startup, I would like it to have a search / find field or button. This will search for the record ID. So when the user types in the record ID it will launch the main form and display that record ID.
Thanks in advance.
I’m working on MS Access 2007. I have a form (Main Form) with information that is filled out by the user. What I am trying to do is make another form that opens when the user launches access (This I can do).
In the form that opens at startup, I would like it to have a search / find field or button. This will search for the record ID. So when the user types in the record ID it will launch the main form and display that record ID.
Thanks in advance.
ASKER
Thanks LSMConsulting,
I am a little lost as I’m new to VBA. But I am very eager to learn.
DoCmd.OpenForm "YourForm", acNormal, , "YourIDField=" & Me.YourPopupFormValue
DoCmd.OpenForm "MainTBL", acNormal, , "CaseID=" & Me.???
What do gets entered in “YourPopupFormValue”
I am a little lost as I’m new to VBA. But I am very eager to learn.
DoCmd.OpenForm "YourForm", acNormal, , "YourIDField=" & Me.YourPopupFormValue
DoCmd.OpenForm "MainTBL", acNormal, , "CaseID=" & Me.???
What do gets entered in “YourPopupFormValue”
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry, typing toooooo fast!
What gets entered in.....
I think I understand. I'll try tomorrow. I'm not at work.
Thanks
What gets entered in.....
I think I understand. I'll try tomorrow. I'm not at work.
Thanks
ASKER
I tried something else.
Thanks.
Thanks.
DoCmd.OpenForm "YourForm", acNormal, , "YourIDField=" & Me.YourPopupFormValue
This would be run on the Popup form, perhaps on a Button click or something. Note too that if YourIdField is a Text value, you must do this:
DoCmd.OpenForm "YourForm", acNormal, , "YourIDField='" & Me.YourPopupFormValue & "'"
Note these methods will open a Filtered form, which means your user would only see a single record (assuming your ID returns a single record, of course).