I have added a command button to a form that will open another form with information relating to the same refence number. It works however it brings up the error message 'Microsoft Office Access can't find the field 'ToggleLink' referred to in your expression' when it opens the other form.
Many thanks to anyone who can help me here
I can't find the problem here can anyone else see it as I don't use Visual Basic, I use Access to create procedures
Private Sub Combo18_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Camera Partnership Ref No] = '" & Me![Combo18] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enforcement Hours to Date"
stLinkCriteria = "[Camera Partnership Ref No]=" & "'" & Me![Combo18] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
Many thanks to anyone who can help me here
I can't find the problem here can anyone else see it as I don't use Visual Basic, I use Access to create procedures
Private Sub Combo18_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Camera Partnership Ref No] = '" & Me![Combo18] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enforcement Hours to Date"
stLinkCriteria = "[Camera Partnership Ref No]=" & "'" & Me![Combo18] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
Last edited: