G
Guest
I have a form (frmFindPerson) which originally referenced a control on a form
(NewEvent) and would open the NewEvent form filtering by PersonID (a number)
using the following code:
Private Sub cmdOpenByPerson_Click()
On Error GoTo Err_cmdOpenByPerson_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "NewEvent"
stLinkCriteria = "[PersonID]=" & Me![PersonID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "FrmFindPerson"
Exit_cmdOpenByPerson_Click:
Exit Sub
Err_cmdOpenByPerson_Click:
MsgBox Err.Description
Resume Exit_cmdOpenByPerson_Click
End Sub
Due to a rather profound change to the design of the database, PersonID now
resides on a subform frmPerson which is a subform of FrmPersonEvent which is
a subform of NewEvent.
I'm going out for surgery in a couple of days and will be out for two months
and perhaps the stress of that is interfering with my syntax writing skills,
but this database has to be completed today or the sky will fall, birds will
lose the ability to fly, and all humanity will lose its hair (sorry, I'm
having a bit of a challenge coping).
If anyone would be kind enough to post the correct syntax for the link
criteria, I would truly be grateful.
TIA,
Trisha
(NewEvent) and would open the NewEvent form filtering by PersonID (a number)
using the following code:
Private Sub cmdOpenByPerson_Click()
On Error GoTo Err_cmdOpenByPerson_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "NewEvent"
stLinkCriteria = "[PersonID]=" & Me![PersonID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "FrmFindPerson"
Exit_cmdOpenByPerson_Click:
Exit Sub
Err_cmdOpenByPerson_Click:
MsgBox Err.Description
Resume Exit_cmdOpenByPerson_Click
End Sub
Due to a rather profound change to the design of the database, PersonID now
resides on a subform frmPerson which is a subform of FrmPersonEvent which is
a subform of NewEvent.
I'm going out for surgery in a couple of days and will be out for two months
and perhaps the stress of that is interfering with my syntax writing skills,
but this database has to be completed today or the sky will fall, birds will
lose the ability to fly, and all humanity will lose its hair (sorry, I'm
having a bit of a challenge coping).
If anyone would be kind enough to post the correct syntax for the link
criteria, I would truly be grateful.
TIA,
Trisha