Command Button to Check Checkbox - 103752

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.
-- 
Kate
Just learning to use access 

0
yons
1/14/2008 3:46:05 AM
access 16762 articles. 3 followers. Follow

1 Replies
1422 Views

Similar Articles

[PageSpeed] 46

On Mon, 14 Jan 2008 05:46:05 +0200, yons wrote:

> 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.


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
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
1/14/2008 5:39:38 AM
Reply:

Similar Artilces:

Bank Rec void check date s/b same as GL void date
When voiding a check in the payables management module and the Void date and Posting date are changed from the original check date, Bank reconciliation should recognize that void date instead of the original check date as the voided date. Please refer to Knowledgebase Article 857704 to see how Ban Rec handles the date of a void check. If a check is voided in Payables Mgmt on a different date than the original date, and bank rec uses the original date trying to reconcile to the general ledger is a problem because the adjusted bank book balance is different than the GL balance becuase th...

Using AutoSum Button results in miscalculations
I have a workbook that has a couple hundred worksheets in it and one o the worksheets is pulling values (via formulas) to it from many of th other sheets. Now, all the values have apparently pulled ove correctly, but when I run an AutoSum totalling all of the values i adds them incorrectly. I verified this by using a calculator and b retyping all the numbers in the next column in the worksheet and usin AutoSum to total those numbers. What could cause this? Is there a rounding problem somewhere? I hav double and triple checked my formulas and they are all correct. I jus don't understa...

Check Reprinting
There are times when AP or Payroll checks are sent to the printer, the Printer jams or for some reason GP stops printing. I am trying to find the best way to handle this. For example. if I am sending 200 checks in my check run and say they start at check number 1 and the printer jams on check number 50. In this case if try to reprint checks from 51 to 200 - GP voids checks numbers 51 to 200 and requires that the next check number should be 201. This means I have to void/trash 150 perfectly good checks. Is there any way to reprint them without the GP "voiding" the checks. T...

Not saving records till "save" command button clicked
If you are in a form and adding information, then close out or go to a new for it just saves the record as long as all applicable fields are filled out. Is there a way to only have a record save if a command button is clicked? -- Message posted via http://www.accessmonster.com If you simply hide the form instead of closing it, I think that will prevent the save. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "szag via AccessMonster.com" <u2885@uwe> wrote in message news:a75249f4b37bb@uwe... > If you are in a form and adding informat...

How to make MSO close the imap connection after checking mail?
Hi, My server does not allow "idle" connections, and therefore the connection to Microsoft Outlook is closed after a while. I then get a error-message from MSO. How can I make Microsoft Outlook close the connection itself after checking mail? (and thereby I will not get that error?) Regards, ´┐Żystein Larsen ...

Control Button
Hello I need some help with a form. What I am trying to do is, to place a button on a form in MS Access so that when you click on it, in another field it will display a number one. If you click on the same button again it will change the one to a two and so on. Wes Private Sub YourCommandButton_Click() YourTextBox = YourTextBox + 1 End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200705/1 "Wes Derhak" <derhak.wg@shaw.ca&...

Option to select printer B4 printing Payables Checks
Client recently upgraded from 7.5 to 9.0 and they lost the option to select a printer after clicking print. From print payables checks In 7.5 when they would click on print, a window would pop up and give them the option to select a printer to send their checks to. Now it automatically goes to their defaulted printer. How do they set up the option in 9.0? Go to the Named Printers settings, and look at the checkbox to suppress the printer dialog box. This should solve your problem Best regards Mike "TROOTBMI" <TROOTBMI@discussions.microsoft.com> wrote in message news:...

Checking cell for Number
I have about 200 numbers in column A. I would like to enter any number in Column B. In column C I would like, it to show if the number is used or free. can this be done with a if statement? Thanks Try... =IF(COUNTIF($A$1:$A$200,B1),"Used","Free") If you have a list of numbers in Column B that you'd like to check, enter the above formula in C1, and copy and paste the formula to your other cells in Column C. Hope this helps! In article <E5CA9196-6FCF-492C-B488-1B7E431720CF@microsoft.com>, Lee <Lee@discussions.microsoft.com> wrote: > I have abou...

add to Runas command
I tried adding some more functionality to the batch file below with no success. Is there a way that I can add to this batch file? For example, color 1f and loading some macros would be great too. Thanks. runas.exe /user:Administrator cmd.exe Below is an example batch file (incorporating the command you quoted ) I have working on my system to add some helpful stuff to a new "cmd" window.... *NB Make sure the batch-file is named ADMCMD.BAT and is in the system's "path" (i.e.; in a folder included in the PATH variable, usually C:\WINDOWS is one) and...

502 Command unimplemented
Howdy, I am having trouble with my Exchange server sending to only some domains. Mainly Hotmail and MSN.. but there are a few others. Some email goes through just fine to other domains. I DO know for sure I can't send to hotmail or MSN. Anyway, the undeliverable message I get back says: There was a SMTP communication problem with the recipient's email server. Please contact your system administrator. <mydomain.com #5.5.0 smtp;502 Command unimplemented> Any clues on what I should do? I am stummped. I can find some info on the error message but no remedy as to how to ...

Checking a folder for new email
Hi, We have a process that sends an email for every message that is processed (3rd party app). This app dies every now and then and the only way we have to find out about it is that we do not receive emails. Is there a way I can have a scrip that runs on my PC that checks every 15mins for emails in this folder? and then, if the oldest email in the folder is older than 2h seen an alert, popup, email or something? Thanks. George. Am Wed, 10 May 2006 15:28:33 -0400 schrieb George Lake: You can use a task reminder. Each time the reminder fires, add 15 minutes to the reminder time with th...

Wizard button text
I am creating a Wizard with slightly non-standard behaviour and I need to change the text of the Finished and Cancel buttons. I can use SetFinishText() for the Finished button but can't see a way to change the text of the Cancel button. Is it possible to do this? The reason I want this behaviour is that the Wizard allows the user to configure devices and I want them to be able to set up several devices without restarting the Wizard each time. So the "Finished" button would be better labelled "Configure" or "Apply" because it applies the settings to ...

Dynamic Button Name?
Hi everone, Can a button name be made dynamic? For example, you create a button and want its name be read from cell A1. So if A1 read "Mike", the button name automatically become "Mike" and so on. Thanks, Mike for a button from the Forms toolbar, you can use this event macro. Put it in the worksheet code module (right-click the worksheet tab and choose View Code") Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Not Intersect(Target, Range("A1")) Is Nothing Then _ Me.Buttons(1).Caption = Range("A1").Value ...

xl97 Custom Built in Button greyed out
we have the office 97 suite loaded on a citrix server and published (not that that is the problem) But for some reason the built in button on the custom chart window is greyed out. The file XL8GALRY.XLS is there. I have sr1 and sr 2 applied. Am I missing something so obvious I'm going to smack my forehead.....again. John M wrote: > *we have the office 97 suite loaded on a citrix server and > published (not that that is the problem) But for some > reason the built in button on the custom chart window is > greyed out. The file XL8GALRY.XLS is there. I have sr1 > an...

List of Internal Commands?
I'm interested in seeing what custom buttons I could set up that may help us operationally. Is there a list of all of the internal commands and what they do? -- John M. ...

Custom real time, time format check
Hello I have a custom form that has two time fields. How can I force users to enter time in those fields as "12:00 AM/PM" or military time 19.00. If input does not match those two rules, pop a warning. This needs to happen as the user moves to another field way before trying to save the form. Any help would be appreciated! . Submitted using http://www.outlookforums.com bearsgone wrote on Fri, 12 March 2010 14:24 > Hello > > I have a custom form that has two time fields. > > How can I force users to enter time in those fields as "12:00 AM/PM&qu...

Is it possible to add Credit Memos to Check Distribution Report?
In GP Check Distribution Report (Reports - Purchasing - Check Information - Check Distribution) is it possible to add Credit Memos that are applied to Invoices on a check? Currently this report by default only shows the Invoices the Check is paying off, but if possible we'd like to show any credit memos associated with invoices on this report. Thanks very much!!! Definitely NOT without a Customization. -- Regards, Vaidy "GPLoveHateRelationship" wrote: > In GP Check Distribution Report (Reports - Purchasing - Check Information - > Check Distribution) is it poss...

Assigning a macro to a "button"
Hello, I have a big spreadsheet with a database and want to make the search feature (CNTRL F)user friendly by adding a "button" to enable this. Unfortunately when creating the macro you cannot stop recording unless you enter data into the search or either close it which obviously renders the "button" useless. I am not familiar with VBA and therefore must do so through the macro recording. Any ideas??? Yvon wrote > Hello, > > > I have a big spreadsheet with a database and want to make the search > feature (CNTRL F)user friendly by adding a "button...

Check Links Purchasing routine & Reconcile Inventory routine *slow
The process is getting stuck/slow at the following (below). I didn't find any info in CustomerSource. Check Links: Purchasing: very slow, took ~4 hours to get to 7% <had to cancel process> Reconcile: Inventory: stuck on 0% for 2 hours <had to cancel process> Any suggestions? Have you tried running check links directly on the server? How are you connecting to the server? Are users in the system when you are running these? -- Victoria Yudin GP MVP "GPI" <GPI@discussions.microsoft.com> wrote in message news:398E7C16-0D04-43B0-A933-E1E990AAC4E5@microsof...

Creating button as cell
This may be a silly easy question, but im new to Excel so Id appreciat someone's help. I was wondering if its possible to create a butto such that the button is a cell itself. So that when you click th cell, it executes the macro assigned to the button. Also, the butto would need to keep the size and coordinates of the cell to which it i created into. If Im not being clear please let ,me know. Thank -- jpizzl ----------------------------------------------------------------------- jpizzle's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2392 View this thr...

custom pos button command
I wnat to make custom pos button for payout,shipping,payment,printer, clear customer, time clock. But I don't know the command for these. If anyone knows. can you help me? Thank you. Hi Nick - set custom button to INTERNAL COMMAND for time clock the syntax is ShowTimeClock for payout the syntax is PostPayout for clear customer the syntax is ClearCustomer the syntax must have the uppercase letters as shown. i don't think the others have variables you can use to set up custom buttons hope this helps "nick" wrote: > I wnat to make custom pos button for payout,ship...

Contacts Right Business Card Buttons wrong language
Hello, somehow my contacts have changed language in the buttons on the address cards, used to be western 123 then a, b, c etc, now it defaults to 123, a, 6, then symbols. Have uninstalled and reinstalled twice to no avail. I have checked the region and language areas and they are all fine. It is just annoying if anyone can help would be welcome. Thanks Michael ...

Don't spell check email addresses and URLs
Whenever I send a message, the spell-check always flags up parts of email addresses and URLs.How can these be excluded from the spell check. Not sure how tied together outlook and word spell checkers are, but outlook does not have "Ignore Internet File Address" option which sounds like it might be what I want, maybe. These are the settings for Outlook spell check. I have seen other spell check S/W that knows strings starting w/ "http://" are URLs and can thus skip the check. You could also argue that xxxx@yyyyy.xxx is a recognizable email and could also be skipped in a ...

making a find button for client name
I am using a database designed with all client info and I need to be able to push a command button and it run a macro that will find part of a name (like last name). Has anyone done this before and can they tell me how to do it? That's built in to Access already, via their drop-down menu (FIND). Why do you want to reinvent the light bulb? "Dawn" wrote: > I am using a database designed with all client info and I need to be able to > push a command button and it run a macro that will find part of a name (like > last name). Has anyone done this before and can they ...

Question on "rollover" type buttons (mfc/activex)
I've got a dialog box with an active-x toolbar. I'd like to have the type of buttons that have simply a bitmap with no border. When the mouse moves over the bitmap, the bitmap changes into a "selected" version of the bitmap. This is just like a "hover" button in html now that I think of it.. Also, are there any good books out there on developing these types of controls? Thanks, ~billy A simple owner-draw button that notices OnMouseEnter/OnMouseLeave events. joe On Mon, 10 May 2004 19:36:31 -0700, "billy" <billy_dev#@#cox#.#net> wrote: &g...