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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I create a pop up on open to go to a specific query in a form?

Status
Not open for further replies.

NeoZakz

Technical User
Jul 22, 2002
25
US
Im trying to make a pop-up window on open that will search for the conformation number of an item and take them right to that record and load all the stuff in the form that goes with it. How can I go about doing this?
 
You don’t need a pop up form. You can build a small unbound form having one input field (confirmation number) and a fetch button.

Your primary form, the one containing all your information should be bound to your primary table.

On the on click event of your fetch button, include something like the following…

Docmd.openform “primaryform”,,,”key = ‘” & me!confirmnbr & “’”

Remember to set your small unbound form to open at start up.

Robert Berman
 
hmm, tried that but couldn't get it to work.
This is what I have so far:
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord acDataForm, "Change Board Records", acNewRec
End Sub

It pops up the window and takes the number(ex:w0008) but when it opens the form it doesnt display what the entry. You know if I'm missing something or not?
 
You are opening the form for input only. Get rid of the acNewRec to eliminate that.

Also, you need the where clause without the where needs to be the fourth parameter and you need a conditional operand like “key = ‘change’”, ie
Docmd.openform “name:,,, “key = ‘change’”.

Why are you using docmd.GotoRecord????

Robert Berman
 
I'm using GotoRecord because I need the form to open up to the specified record in the input window. I'll try the openform way though hadn't thought of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top