hello
I have created forms and now I want to print it. But I want to print it as a single form. I dont want all the forms to be printed.
I only want to select a primary key then print the form that belongs to that primary key.
I enter this code
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID1] = " & Me.[ID1]
DoCmd.OpenReport "database", acViewPreview, , strWhere
End If
but it keeps giving me this error
as in attachment
appreciate your help...
I have created forms and now I want to print it. But I want to print it as a single form. I dont want all the forms to be printed.
I only want to select a primary key then print the form that belongs to that primary key.
I enter this code
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID1] = " & Me.[ID1]
DoCmd.OpenReport "database", acViewPreview, , strWhere
End If
but it keeps giving me this error
as in attachment
appreciate your help...