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

Check for record, if exists fill in, if not leave form blank

Status
Not open for further replies.

laruajo

MIS
Sep 16, 2002
24
US
Let me see if I can explain this clearly. I have a form that has a multiple field primary key-SONum and IRRNum- one SONum can have a couple IRRNums, each record containing different data. What I would like the form to do is: when a user goes in and types in a SONum in the field, if it already exists, the data is displayed (if there are several records with that SONum-different IRRNums, they can flip through all the records with that SONum) if it does not exist then the form remains blank (except for the SONum that was just filled in and the user can finish filling the form. I tried to accomplish this with a combo box for the SONum field, but could not figure it out. Any suggestions??
 
I do use a similar approach for searching records on subforms.

My approach was to create two hidden text boxes (visible whilst testing). I had two combo boxes in my case one for names the other for addresses, in yours one for SO Num and one for IRRnum.

Then in the underlying query for the combobox for the soNum we add a field for the IRRnum, and then group by First. On change in the combo box we populate the two hidden text boxes with the SoNum and IrrNum of the record we want to find.

The subform child fields are dual linked to the two hidden fields. Therefore after a small delay the subform appears with the matching record. If you then choose an lternative IRRnum depending on how you have set it up, after a small dealy another record appears.
 
Thank you for the suggesting but I am not sure it is exactly what I am looking for. First of all I do not have a subform. I only want to look up a SO Num. If it exists it will display the first record with that SO Num and then they can flip through the rest, each with a different IRR Num. If that SO Num does not exist then the user can fill in the record with that SO Num. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top