Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with AutoNumber and E-mail after Upsizing - Newbie 1

Status
Not open for further replies.
Apr 25, 2002
69
US
I created a form in Access2000 for a help desk request. When the user hits the submit button an e-mail is fired off to the help desk folks (the code is in the OnEnter event). The e-mail subject line contains the Ticket Number. The ticket number is an autonumbered field. (Thanks to all the folks here who taught me how to do this.) In my test environment I used the Upsize Wizard to put the tables in a SQL database. Now when a ticket is submitted, the Ticket number doesn't appear in the e-mail anymore. Going back to my Access database I see when I type in the form, the ticket number is generated at the first keystroke. In the upsized one, the ticket number doesn't fill in at all. I assume it is generated after the form is closed. Is there any way to make the Ticket number appear in the e-mail? If I have to change the AutoNumber Ticket number field to a regular number field and increment by one, could someone tell me how to do that? Many thanks for your help.
 
Just the differences between Access and SQL autonumber setting. Access creates the number when you enter your first keystroke while SQL creates it when you save the record.

Have you tried to save the record before firing off the email?
 
Actually, you pointed me in the right direction. While the form is open, if I choose Edit/Select Record, then it works fine. Now I just have to figure out the code to do this in the submit button. Many thanks for your help.
 
Try this code -

DoCmd.RunCommand acCmdSaveRecord

to force a save on your form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top