query and populate new form

bbulla

I'd rather be golfing
Local time
Today, 18:54
Joined
Feb 11, 2005
Messages
101
OK,

I have a main form with a field LocID. When a user hits a button I want a query to run that uses the LocID and query a table to see if there are matching records with that LocID. If there are, then open a form showing the matched records. If not, then open the same for as previous, but with all blank fields.

Do I need to make a recordset, check to see if the recordset is empty and then go from there??

How do you make a recordset right in Access VBA? The same as with an ADO connection through VB??

Thanks,

Brian
 
You can use something like this


Private Sub locid_DblClick(Cancel As Integer)
DoCmd.OpenForm "yourformname", , , "[Flockid]=" & "'" & Me![locid] & "'"
End Sub
 

Users who are viewing this thread

Back
Top Bottom