check for button click

David b

Registered User.
Local time
Today, 23:44
Joined
Mar 2, 2003
Messages
102
I have a form with a sub form which displays a number of record which are to send to an email in outlook.
On the form is a button which creates the email.
On the form`s close event I want to check if the create email button has been clicked and if yes run an update query to mark the records as sent
Any suggestions on how to do this
TIA
david b
 
Use a boolean variable.

On the click of the button set the boolean to True.

On closing the form, check if the boolean is True, if it us run your update query and reset the variable to False.
 
OK thanks for the reply.
Not sure how to do that.
DB
 
In a module create a public boolean like this:

Public pbooClickTest As Boolean

Now you can use this variable throughout your database and it can only have one of two values: True or False - I think it defaults to false.

On the click of your button, you can add the code:

pbooClickTest = True

to signal that button has been clicked.

Then, in the code you have for the form closing check to see if pbooClickTest = True, if it is you can run your update query, if not, don't.

Then, just reset the variable to False.
 
At the end of the code to create the message i have this but it is not doing as it should. what have I missed ?
The test button is always returning No

Dim pbooClickTest As Boolean
pbooClickTest = True

Db
 
Have a look at this - you don't have to Dim the variable as you declare it in the module.
 

Attachments

Got it now
Many thanks for your help
David b
 

Users who are viewing this thread

Back
Top Bottom