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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stLinkCriteria question

Status
Not open for further replies.

milte

Technical User
Jan 30, 2002
20
US
Hello everyone,

I have a search form with columns and rows. A user can click a cell and it will filter by that cell. A user can double click a field and the record will open based upon the field that was double-clicked. We recently upgraded to Officer 2003 and now we are having issues with the code. After the user double-clicks, the record opens up, but on top of the record is a parameter pop up box. If the user clicks cancel on the parameter box, then he can work on the record. How can I prevent that parameter box from opening? The desired record is already there, it's just behind the parameter box. I have a feeling the problem is in the stlinkcriteria line.

Here is the code:

Private Sub ControlNumber_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmTask"

stLinkCriteria = "[ControlNumber] = Forms![frmSearch]![ControlNumber]"

DoCmd.OpenForm stDocName, , , stLinkCriteria

DoCmd.RunCommand acCmdApplyFilterSort

Exit_ControlNumber_DblClick:
Exit Sub
Err_ControlNumber_DblClick:
MsgBox Err.Description
Resume Exit_ControlNumber_DblClick
End Sub

Thanks,
Paul
 
I believe you statement should be:

stLinkCriteria = "[ControlNumber] = " & Forms![frmSearch]![ControlNumber]
 
Thanks for the response. This database has gone from version 97, to 2000 and now to 2003. This statement has had to be changed each time. I just now fixed it by using:

stLinkCriteria = "[ControlNumber] =" & "" & Me![ControlNumber] & ""

I just tried your version and it works also.

Thanks again,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top