B
bubbles
I have a form with a command button that takes me to a report. In a previous
question I asked how to ensue that the record I was viewing on the form was
the one whose information was shown in the report. This has now been
achieved thanks to contributers replies by using the following code.
Private Sub cmd210Print_Click()
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 = "[of ref] = """ & Me.[OF REF] & """"
DoCmd.Close
DoCmd.OpenReport "210 LETR - Showing Interest", acViewPreview, ,
strWhere
End If
End Sub
I now have the reverse problem. I want to ensure that I return to the same
form as I left and to the same record and preferably the same field. In
otherwords after viewing and printing the form I need to return to the same
spot in the form. Is this possible?
question I asked how to ensue that the record I was viewing on the form was
the one whose information was shown in the report. This has now been
achieved thanks to contributers replies by using the following code.
Private Sub cmd210Print_Click()
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 = "[of ref] = """ & Me.[OF REF] & """"
DoCmd.Close
DoCmd.OpenReport "210 LETR - Showing Interest", acViewPreview, ,
strWhere
End If
End Sub
I now have the reverse problem. I want to ensure that I return to the same
form as I left and to the same record and preferably the same field. In
otherwords after viewing and printing the form I need to return to the same
spot in the form. Is this possible?