Check query to see if record exists

Scottyk537

Registered User.
Local time
Today, 14:25
Joined
May 25, 2006
Messages
48
Hello all,
I have a form that looks at my "master table" where users put in general info about a sheet of material.
There are two combo boxes on this form, Batch# and Lot#. They will use the same Batch# and Lot# for many sheets. Every time a new batch and lot are entered, this will bring up a pop-up form where the user needs to take a measurement of that batch and lot for QA. This will go into a different table, where the batch and lot #'s are unique(many of the same batch#'s with different Lot#'s).
After the lot# is entered, I want to run a query in VB that looks for those unique identifiers, and if it doesn't find a record, my pop-up form will run.
This is probably something very easy....... It was a very long weekend and I'm tired of thinking.

Thanks
Scott
 
If the Query is providing data for a form Me.RecordSet.RecordCount = 0 Tells you there are no records. You could test for this in the OnLoad event of the form and put up a MsgBox.
 
Got it......

Thanks for the help..... I really could not figure out your solution.
I figured out a way of doing it that works fine for me. Probably not the best way but:
I put an unlinked subform on my main page that is based on a query where the criteria looks at my batch and lot #'s on my main page. I put an Afterupdate event on Can#, to requery this sub-form. If nothing exists in the measurement fields, then it brings up my measurement Form with the batch and Can #'s copied to it.
My brain always hurts on Monday...................
 

Users who are viewing this thread

Back
Top Bottom