Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Command Button to Check Checkbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
yons - 14 Jan 2008 03:46 GMT
Trying to create a command button to check certain boxes.
Table is Addresses
Married is checkbox
PrintLabel is checkbox

Want to check printlabel on all forms that married is not checked.
The If statement works on the form I am on only,
so I tried an SQL but says syntax error.

Private Sub cmdCheckAllPrintLabel_Click()
On Error GoTo Err_cmdCheckAllPrintLabel_Click
   'If Me.Married = False Then
       'Me.[Print Label] = True
   'End If
CurrentDb.Execute "UPDATE Addresses Where [Married] = 0 Set [Print Label] =
-1", dbFailOnError
Me.Requery

Exit_cmdCheckAllPrintLabel_Click:
   Exit Sub

Err_cmdCheckAllPrintLabel_Click:
   MsgBox Err.Description
   Resume Exit_cmdCheckAllPrintLabel_Click

End Sub

Thanks in advance.
Signature

Kate
Just learning to use access

fredg - 14 Jan 2008 05:39 GMT
> Trying to create a command button to check certain boxes.
> Table is Addresses
[quoted text clipped - 24 lines]
>
> Thanks in advance.

regarding: >Want to check printlabel on all forms that married is not
checked.<
It seems you are mixing up the word 'forms' for the word 'records'.
A table contains records (which in turn contains fields) which stores
the data.
A form displays the record's data and allows data entry and
manipulation.

Try it this way:

CurrentDb.Execute "UPDATE Addresses Set Addresses.[Print Label] =
-1  Where [Married] = 0;", dbFailOnError
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.