Test linked form for data

C

CJ

Hi Groupies

How can I test to see if a linked form, that might not be visible, has data?

My main form has a yes/no box that enables a button when it is set to yes.
The button opens a linked form. When the user moves to the next record, I
would like the main forms BeforeUpdate event to make sure that the yes/no
box is not set at No while there is data in the linked form for that record.

I have tried something like:

If Me.Form.frmVehicles.RecordsetClone.RecordCount > 0 And Me.CompanyVehicle
= False Then
Cancel = True
MsgBox "Please check vehicles", vbOKOnly
Me.frmVehicles.Visible = True
End If

When I test it, things just hang up. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top