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

select/deselect all records in form

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
Monthly we import customer address information and need to print labels. The import is done when the database is opened (autoexec). From there the user brings up a form that displays the data as well as a checkbox. The checkbox is so the user can choose which records they want labels created for. Typically there isn't very many records but occasionally there are more than 50. I would like to create a command button that will automatically select/deselect the checkbox so the user doesn't have to do it one at a time. Does anyone have any samples how this could be accomplished?
 
In the Click event procedure of the button:
Code:
Docmd.RunSQL "UPDATE [i]yourTable[/i] SET [[i]your YesNo field[/i]] = (Not [[i]your YesNo field[/i]])"
Me.Refresh

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry it took so long to get back. That worked great! thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top