Open form based on selected record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
The following code seems to open the correct form, but always on record 1,
rather than the record being viewed in the FrmContacts form. Have I made a
mistake?
Thanks Tim (Access 2002)

DoCmd.OpenForm "frmUdateContacts", , , [ContactID] =
Forms![frmcontacts]![ContactID]
 
Try this:

DoCmd.OpenForm "frmUdateContacts", , , "[ContactID] =
Forms![frmcontacts]![ContactID]"
 
Rowiga, thank you very much, took me a while to see the difference""" thank
you!

rowiga said:
Try this:

DoCmd.OpenForm "frmUdateContacts", , , "[ContactID] =
Forms![frmcontacts]![ContactID]"


Timboo said:
Hi,
The following code seems to open the correct form, but always on record 1,
rather than the record being viewed in the FrmContacts form. Have I made a
mistake?
Thanks Tim (Access 2002)

DoCmd.OpenForm "frmUdateContacts", , , [ContactID] =
Forms![frmcontacts]![ContactID]
 
Rowiga, it workes, thank you, tim

rowiga said:
Try this:

DoCmd.OpenForm "frmUdateContacts", , , "[ContactID] =
Forms![frmcontacts]![ContactID]"


Timboo said:
Hi,
The following code seems to open the correct form, but always on record 1,
rather than the record being viewed in the FrmContacts form. Have I made a
mistake?
Thanks Tim (Access 2002)

DoCmd.OpenForm "frmUdateContacts", , , [ContactID] =
Forms![frmcontacts]![ContactID]
 
Sorry for the suptle reply. Criteria has to be enclosed in quotes. That
applies to VBA and even when using things such as domain aggragate functions.

Timboo said:
Rowiga, it workes, thank you, tim

rowiga said:
Try this:

DoCmd.OpenForm "frmUdateContacts", , , "[ContactID] =
Forms![frmcontacts]![ContactID]"


Timboo said:
Hi,
The following code seems to open the correct form, but always on record 1,
rather than the record being viewed in the FrmContacts form. Have I made a
mistake?
Thanks Tim (Access 2002)

DoCmd.OpenForm "frmUdateContacts", , , [ContactID] =
Forms![frmcontacts]![ContactID]
 
Back
Top