Let me say this up front. I'm a novice using MS Access. But here's my problem. I have a database created with Access 97 that I have code to run a report for only the current record. It works fine. But when I try to copy the code to another database created in Access 2000, it won't run. I get a run time error "2465 Microsoft Access can't find the field 'I' referred to in your expression".
Here's the code
Dim strWere As String
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "SELECT A RECORD TO PRINT"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "rptPrintRecord", acViewPreview, strWhere
End If
Do I need to change something in the expression or is it because code for 97 is different then 2000.
Here's the code
Dim strWere As String
If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "SELECT A RECORD TO PRINT"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "rptPrintRecord", acViewPreview, strWhere
End If
Do I need to change something in the expression or is it because code for 97 is different then 2000.
