you CAN cancel the Open event, it's the Load event that does not have a
Cancel argument. if you're looking for a particular record, then you must
have some criteria that serves to identify that record. if the form is bound
to either a table or a query, you can run a DCount() function in the Open
event, using the identifying criteria, and cancel if the function does not
return at least one record, as
If DCount(1, "TableOrQueryName", "SomeField = somecriteria") < 1 Then
Cancel = True
End If
if you're opening this form from another form (like a menu or switchboard,
for example), suggest you check for the presence of the record *before*
opening the form, as
If DCount(1, "TableOrQueryName", "SomeField = somecriteria") > 0 Then
DoCmd.OpenForm "FormName"
End If
hth
SubXO said:
As a form starts up, I need to check to see if a particular record is present
and terminate the form startup if not. You can't cancel any event except
load, and you can't use the related table and recordset until the Current
event. How can I terminate a form without closing the database (quit
call)?