Toggle Button to hold last choice

B

Bob Vance

I have a toggle button that either allows or stops the report from being
emailed, but if I close my database down it will not hold my last choice
tblAdminSetUp.Mailflag is a yes/no field
Any help please....Thanks Bob

Private Sub cmdSendMail_Click()
If cmdSendMail.value = True Then
cmdSendMail.Caption = "Send Email"
Else
cmdSendMail.Caption = "Do Not Send Email"
End If
CurrentDb.Execute "update tblAdminSetup set MailFlag = " & cmdSendMail.value
End Sub
 
K

KARL DEWEY

Have you considered using Set Value on the Default of the button?
Another way is to create a table with one field and one record and use an
update query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top