Erroring Openeing Subform

G

Guest

Hi,

I have a mainform / subform which when the user double clicks on the
subform, it opens a pop up form which displays the record slected in the
subform so the user can edit data.

I use the following to open the pop up form:

DoCmd.OpenForm "frm_BkpExec_Ntepad", , , "id = " & me!id

This works fine, except if there are no records in the subform, and the user
still double clicks in that window, then an error gets returned.

How can I have this so that when the user double clicks in this window and
there are no records in the subform, the double click is just ignored?

Any help is always greatly appreicated...
GLT
 
G

George Nicholson

If Not IsNull(me!id) Then
DoCmd.OpenForm "frm_BkpExec_Ntepad", , , "id = " & me!id
End if
 
G

Guest

Thanks George works great - have a great day :)

George Nicholson said:
If Not IsNull(me!id) Then
DoCmd.OpenForm "frm_BkpExec_Ntepad", , , "id = " & me!id
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

Top