Forms Programming

K

Karen Howard

I would like to know the "Event Procedure" for assigning a
command button that once I update the form's data (i.e.,
add new information to a field), I can click on the
preview report button and this information has already
been updated.

What I currently have to do is go to the "Next" record and
preview the report for the previously inputted information
to be viewed on the report. Any suggestions? Thanks!
 
R

Rick Brandt

Karen Howard said:
I would like to know the "Event Procedure" for assigning a
command button that once I update the form's data (i.e.,
add new information to a field), I can click on the
preview report button and this information has already
been updated.

What I currently have to do is go to the "Next" record and
preview the report for the previously inputted information
to be viewed on the report. Any suggestions? Thanks!

Me.Dirty = False
or
DoCmd.RunCommand acCmdSaveRecord

I prefer the former as the second one applies to whatever form has focus which in
some cases might not be the form you intend to do the save on. In your case that
would not be a problem since the form would have to have focus when the command
button was clicked on.
 
R

Rick Brandt

Karen Howard said:
I set the "Focus" for the form? Please advise. Thanks!

As I stated in my previous rely. If you run this code as the result of pressing a
command button on the form where you want the save to occur then that form will
already have focus (you just clicked on one of its objects).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top