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!

Query/Outlook sent question

Status
Not open for further replies.

MFrancis

Technical User
Joined
Jan 25, 2002
Messages
6
Location
US
I have a form with a control button. When clicked, a query box pops up and askes for a client number. After entering the client number a report is generated off of that number and automatically attached to an e-mail (outlook).
What I need is to have a Yes/No field in the record and for it to change to "Yes" when the button is clicked so that I may track if the report has been generated.
Is this possible, and if so how would I do this? Or is there an easier way? Thank you so very much.
 

Yes it’s possible. The way I would do this is write an append SQL statement based upon the user’s answer for the client number.

hth,
GGleason
 
Not to sure about SQL, can you explain a little bit more please.
 
There is a query type called an update query (not an append query as I first wrote). You can dynamically write an SQL statement that will update the field in your table.
 
Good idea! But your solution depends a little on your progamming level. Adding a yes/no field to a record does not require great skill, but setting it's value based on the report generation (and message sending?) is a little more difficult. 'GGleason' is right to suggest an update query, but..
Easy Way -> you can put your UPDATE query into the event handler for the button click. (this will be fine for most occassions, unless your report fails to generate)
Hard Way -> you should execute it based on the result of the report generation, rather than the button click (even if you think there is no chance that the report generation could fail, because I can almost guarantee that it will at some stage). This simply means that you should put your update query either into the OnClose event of the report, or combine it with the function that generates the report.
My choice would be based on the confidence my programming ability, the time I had to implement & test, the reliability of the other code used for the report and message sending and if I could live with the (hopefully small) percentage of time that the report generation could fail).
(Notes) - Set the default of the yes/no data field to 'No'. -Leave the value as 'No' or 'False' in your update function unless you can be sure the report has generated. -Setting the value of your yes/no field based on whether the message (containing the report?) is sent is probably a little too advanced for this forum.
Good luck.
 
Thank you so very much for your help-I will try it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top