Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a linked record/form with double-click event

Status
Not open for further replies.

bgibsonIYD

Technical User
Jun 18, 2001
28
US
I have a form "Registration" and a list box on the form [GROUP ID]. I would like the user to be able to double click on the [GROUP ID] field to pull up another form called "Group Members" with the corresponding record. I have the following code:

Private Sub GROUP_ID_DblClick(Cancel As Integer)
On Error GoTo Err_GROUP_ID_DblClick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Group Members"
stLinkCriteria = "[GROUP ID]=" & Me![GROUP ID]

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_GROUP_ID_DblClick:
Exit Sub
Err_GROUP_ID_DblClick:
MsgBox Err.Description
Resume Exit_GROUP_ID_DblClick

End Sub

I keep getting the error message:

"Syntax error (missing operator) in query expression"

Help? Beth
**Learning Access**
 
Try this,
stLinkCriteria = "[GROUP ID]= '" & Me.[GROUP ID] & "'"
 
I am still getting the same error message. This code works fine with a click event that I have on a command button on another form. I dont understand why it's not working here. Beth
**Learning Access**
 
Okay--now I got that code to work. I wasn't reading the code right. But, now i'm getting the message:

"The OpenForm action was canceled"

Suggestions? Beth
**Learning Access**
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top