If statments

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

On my form i have a button that when it gets pressed it adds data to
the subform. the code works fine

I just want a if statment that will stop the code working if data
alredy existes in the subform.

If data exists i want a error message, if ther is no data let the code
run


Im not sure how to code it for it to see if there is data in the
subform


Any help will be great


Simon
 
oh, didn't realise that

If Not IsNull(Me.SUBFORMNAME.Form.PRIMARYKEYNAME) Then
Msgbox "Records exist.",vbinformation,"My Title"
exit sub
End If
 

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

Back
Top