I have a script I am trying to use in Access 2007. I am using it in a form to automatically insert data from a field in one form, into another form. I use a similar script in a different form without any problems. When I try to use it in this new form, I get an error when I double click the field that reads "Type Mismatch" Can someone tell me what is causing the error?
Private Sub On_Hold_DblClick(Cancel As Integer)
On Error GoTo Err_On_Hold_DblClick
Dim stDocName As String
Dim stLinkCriteria As Integer
Me!LastRecordNumber = Me.CurrentRecord
stDocName = "FrmStatus"
stLinkCriteria = "([MOLineKey1]='" & Me![MOLineKey] & "')"
DoCmd.OpenForm stDocName, , , stLinkCriteria