Set the Dirty property of the form, like this:
Private Sub cmdPrint_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 = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Michael Charney" <me@you.com> wrote in message
news:FE*******************@newssvr19.news.prodigy. com...
I have a form that is tied to a table. On this form I have a button that
when clicked prints a report based on the information currently on the
form. The problem is that unless the user tabs past the last control and
moves to a new record, and then back to the record they just entered, the
report prints blank.
I know there is a way to update the record to the table without moving
forward and back on the form, but I can not remember what it is. I think
it
is something about Rocord.Update but I can not find the exact command I am
looking for.
Anyone know how to do this?
Mike Charney