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!!!
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!!!