The ideal method is to create the report's design first and simply fill it
with data from the form. There are many ways to do this, but here's one of
the simplest (air code):
Sub MyButton_Click()
On Error GoTo Error_Handler
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField
DoCmd.SetWarnings False
DoCmd.OpenQuery "Your Update Query"
Exit_Here:
DoCmd.SetWarnings True
Exit Sub
Error_Handler"
MsgBox " Err.Number & ": " & Err.Description
Resume Exit Here
End Sub
There are better ways of running the update query, but that one is the
simplest.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
"Nigel Molesworth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've got a data input from on my database. When I have input the data
> (often a single item) I then:
>
> close the form
> create a report
> print the report (a label)
> run an update query
>
> The update query (which asks me twice if I'm sure) is to remove a
> "print me" flag and put the current date in the date field.
>
> This would be so much easier if I could do it all from the input form,
> preferably from a single button, but at this stage I don't know if the
> underlying table has been updated with the data.
>
> Even if I had to close the input form first, is it possible to
> automate such tasks, as in a macro?
>
> --
> Nigel M