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!

Yes/No box to Equal No on Table Startup 1

Status
Not open for further replies.

hahnsm

MIS
Joined
Jun 17, 2003
Messages
62
Location
US
Everytime my Access table named TblAddresses is opened, I need my column named LabelSelection, a yes/no data type, to equal NO. What code can I use to complete this task?
 
Before you exit from the application you can run an update query on TblAddresses that sets LabelSelection to be no.

That way on entering the database again the field would be set to no.


Steve
 
I have never worked with an update query before. How do I do this? Thank you so much for helping me out with this!!
Sadie
 
Sadie,

The SQL Statement would look something like this for the update that you would need to do.

UPDATE Table3 SET Table3.[YES/NO] = No;

The steps from the query design would be as follows -

1 - Add the table that has the Yes/No field that you wish to update.

2 - Select the query menu option and choose Update

3 -Set your update value to be No


Next if you create a button to exit your application

you can set the On Click of the button to be something

like this -



Private Sub ExitApp_Click()
On Error GoTo Err_ExitApp_Click

DoCmd.OpenQuery "ResetTable" 'Reset Table is the Update Query Name
DoCmd.Quit

Exit_ExitApp_Click:
Exit Sub

Err_ExitApp_Click:
MsgBox Err.Description
Resume Exit_ExitApp_Click

End Sub


 
No problem. I hope I gave you enough to go on.

:-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top