By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,481 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,481 IT Pros & Developers. It's quick & easy.

Record Update

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

Nov 13 '05 #2

P: n/a
you could also just go to the button control and before it does the
report printing do:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh

Nov 13 '05 #3

P: n/a
I apologize if this ends up as a double post

Try this, In your button event for printing put the following at the
begining

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh
--------------
Billie
http://www.orpgs.com

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.