Add "criteria prompt" to my VB Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which I enter the data for a new record. When I've entered my
last piece of data, I want to click on a command button which will email a
report of the data from that newly entered record.

My report is queued off of a query which prompts for ID. I want that
criteria prompt to automatically be the current record I'm editing. The code
for my command button is below. Is there anything I can add following
"Report1" to fulfill by "Enter ID" prompt?

DoCmd.SendObject acSendReport, "Report1", acFormatHTML,
"(e-mail address removed)", , , "VB Code Test", , False

p.s. my pc locked up the 1st time I sent my question. If both questions
appear, I apoligize. Thanks!!!
 
Have you run this code? It should prompt you "Enter ID" if the query prompts
you when you open it alone.
Another alternative is to place the ID of the current record in the queries
criteria:
=Forms.[form_name].[ID]
Hope this helps,
Bob
The form has to be open for this to work
 
Back
Top