G
Guest
Hi,
I am trying to open a 2nd form by double clicking on the ID code on the
first form (both forms are based on the same query and share the ID control.
I read the following suggestion in a 2004 post and implemented it:
"You could use another event, such as double-clicking on a field. The
following code opens a second form by clicking on the ID field, and filters
the second form by matching the ID field to the value of the current record
on the 1st form.
Private Sub ID_DblClick(Cancel As Integer)
On Error GoTo Err_ID_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PUTYOUR FORMNAME HERE"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ID_DblClick:
Exit Sub
Err_ID_DblClick:
MsgBox Err.Description
Resume Exit_ID_DblClick
End Sub"
However, when I double click on the ID control of the first form I get a
window that says: "Enter Parameter Value". It is as though it is having a
problem passing or understanting the ID code. The ID code is in this format:
"BBB-0000-00"
I would appreciate any suggstions. Thanks.
Trauton
I am trying to open a 2nd form by double clicking on the ID code on the
first form (both forms are based on the same query and share the ID control.
I read the following suggestion in a 2004 post and implemented it:
"You could use another event, such as double-clicking on a field. The
following code opens a second form by clicking on the ID field, and filters
the second form by matching the ID field to the value of the current record
on the 1st form.
Private Sub ID_DblClick(Cancel As Integer)
On Error GoTo Err_ID_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PUTYOUR FORMNAME HERE"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ID_DblClick:
Exit Sub
Err_ID_DblClick:
MsgBox Err.Description
Resume Exit_ID_DblClick
End Sub"
However, when I double click on the ID control of the first form I get a
window that says: "Enter Parameter Value". It is as though it is having a
problem passing or understanting the ID code. The ID code is in this format:
"BBB-0000-00"
I would appreciate any suggstions. Thanks.
Trauton