S
Scott_Brasted via AccessMonster.com
Greetings,
I am trying to get this piece of code to work. I want to double click a name
in a subform and have the record in another form open. tblContributors.
[ContributorID] is the name of the hidden primary key field of the table that
holds the data for the form I want to open. So I make a function named
ViewDonor and then call it in Sub txtDonorLastName_DblClick. I thought that
the DoCmd.OpenForm should work. Obviously I am wrong. I get an error that
says "variable not defined" and it highlights the second tblContributors.
Anyone know what I am doing wrong? Anyone but me not know what I am doing
wrong?
Thanks,
Scott
Option Compare Database
Option Explicit
--------------------------------------------------
Private Sub ViewDonor()
On Error GoTo Err_ViewDonor
DoCmd.OpenForm "frmViewDonor", , , "tblContributors.[ContributorID]=" &
tblContributors.ContributorID
Exit_ViewDonor:
Exit Sub
Err_ViewDonor:
MsgBox Err.Description
Resume Exit_ViewDonor
End Sub
I am trying to get this piece of code to work. I want to double click a name
in a subform and have the record in another form open. tblContributors.
[ContributorID] is the name of the hidden primary key field of the table that
holds the data for the form I want to open. So I make a function named
ViewDonor and then call it in Sub txtDonorLastName_DblClick. I thought that
the DoCmd.OpenForm should work. Obviously I am wrong. I get an error that
says "variable not defined" and it highlights the second tblContributors.
Anyone know what I am doing wrong? Anyone but me not know what I am doing
wrong?
Thanks,
Scott
Option Compare Database
Option Explicit
--------------------------------------------------
Private Sub ViewDonor()
On Error GoTo Err_ViewDonor
DoCmd.OpenForm "frmViewDonor", , , "tblContributors.[ContributorID]=" &
tblContributors.ContributorID
Exit_ViewDonor:
Exit Sub
Err_ViewDonor:
MsgBox Err.Description
Resume Exit_ViewDonor
End Sub