Using StLinkCriteria to Link to record in form

OldBlonde

Sharron
Local time
Today, 18:24
Joined
May 12, 2008
Messages
2
Ametuer Database player here, having a real blonde day, just spent 20 minutes trying to figure out how to post a message.

I have a form that is based on multiple tables in a query for the purpose of Mr "I Hate computers" to view product information. Have a second form on single table with subforms etc for Data entry Purpose.

Have had a command button (now lost) on "view only" form to go to the matching record in the "Edit Form". Can't get it to link to matching record anymore. The PRODUCTID Field is a TEXT field in the main table.

Click Event Procedure is as follows

Private Sub CmdOpenProd_Click()
On Error GoTo Err_CmdOpenProd_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmAllProducts"

stLinkCriteria = "[ProductID]=" & "'" & Me![ProductID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CmdOpenProd_Click:
Exit Sub
Err_CmdOpenProd_Click:
MsgBox Err.Description
Resume Exit_CmdOpenProd_Click

End Sub

I'm not sure now whether I had the original connection on a Macro or Command Button, but I can't seem to make either work.

Any Help Greatly appeciated. Now Backup up my forms!!!
 
Solved StlinkCriteria issue on form link

May have solved this myself. I suspect at some point I had turned the Filter Records option to Off in the form properties. My link is now working:)
 
Glad you got it sorted out.

Who is Mr "I Hate computers"?
 

Users who are viewing this thread

Back
Top Bottom