After reading almost everywhere on this site to get rid of macros I am trying to write code for the simple stuff. Can anyone tell me what I am missing? I am trying to open the Building Info report based on the field "BuildingNo".
Private Sub Command43_Click()
On Error GoTo Err_Command43_Click
Dim stDocName As String
stLinkCriteria = "[buildingno]=" & Me.BuildingNo
stDocName = "BuildingInfo"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_Command43_Click:
Exit Sub
Err_Command43_Click:
MsgBox Err.Description
Resume Exit_Command43_Click
End Sub
I keep getting a data type mismatch in criteria selection.
Private Sub Command43_Click()
On Error GoTo Err_Command43_Click
Dim stDocName As String
stLinkCriteria = "[buildingno]=" & Me.BuildingNo
stDocName = "BuildingInfo"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_Command43_Click:
Exit Sub
Err_Command43_Click:
MsgBox Err.Description
Resume Exit_Command43_Click
End Sub
I keep getting a data type mismatch in criteria selection.