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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using one cmdButton to perform 3 functions

Status
Not open for further replies.

ironj32

Technical User
Dec 7, 2006
73
US
i have a command button that will send out an email for a specified record. i would like to use the same button to remove that record from the table/form and also add it to another table(history table). i am thinking that i might have to have an append query(to history table) and also a delete query??? maybe a macro would be something to use? in short: i want the cmdSendEmail button to send out the email, add the record to a history table, and also delete the record from the current form/table with just one click and without having to hit "ok" a bunch of times.
any suggestions on how i should go about doing this.
thanks!
 
How are ya ironj32 . . .
[blue]i am thinking that i might have to have an append query(to history table) and also a delete query??? . . .

. . . maybe a macro would be something to use? [/blue]
Sounds viable to me only I'd use VBA instead!

Calvin.gif
See Ya! . . . . . .
 
button onclick


command to send the email

SetWarnings False

command to run the append query
command to run the delete query

SetWarnings True

Let them hate - so long as they fear... Lucius Accius
 
i am having trouble getting it to do it one record at a time. i am using a tabular form, so each record has it's own command button, but when i click on it, it appends all the records. i need to do each record individually.
 
You need to rethink your continuous form. Maybe a master/subform type of setup where you can select single records.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
whoops. all i need to do was set criteria for the append query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top