Command Button to Uncheck Checkbox on all records

I create a command button to uncheck a checkbox on the form, which works, but 
I want it to uncheck the the same checkbox on all records. I am doing this 
for the church and am not using access on a regular basis, so I just need the 
rest of the code. Thanks for any help.
-- 
Kate
Just learning to use access
0
Utf
1/8/2008 2:15:00 AM
access 16762 articles. 3 followers. Follow

11 Replies
1531 Views

Similar Articles

[PageSpeed] 39

Kate,

You will need an Update Query.  You can do this in code, which runs on 
the Click event of your command button, like this:

CurrentDb.Execute "UPDATE YourTable SET YourYesNoField = 0", dbFailOnError

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> I create a command button to uncheck a checkbox on the form, which works, but 
> I want it to uncheck the the same checkbox on all records. I am doing this 
> for the church and am not using access on a regular basis, so I just need the 
> rest of the code. Thanks for any help.
0
Steve
1/8/2008 2:25:12 AM
I am geeting an error. My table is named Addresses and my checkbox is named 
IndividualReport.
Here is my code:
Private Sub Command239_Click()
       If Me.IndividualReport = True Then
        Me.IndividualReport = False
    End If
'CurrentDb.Execute "UPDATE YourTable SET YourYesNoField = 0", dbFailOnError
CurrentDb.Execute "UPDATE Addresses SET IndividualReport = 0", dbFailOnError
End Sub

I don't know any code.
Thanks 

-- 
Kate
Just learning to use access


"Steve Schapel" wrote:

> Kate,
> 
> You will need an Update Query.  You can do this in code, which runs on 
> the Click event of your command button, like this:
> 
> CurrentDb.Execute "UPDATE YourTable SET YourYesNoField = 0", dbFailOnError
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Kate wrote:
> > I create a command button to uncheck a checkbox on the form, which works, but 
> > I want it to uncheck the the same checkbox on all records. I am doing this 
> > for the church and am not using access on a regular basis, so I just need the 
> > rest of the code. Thanks for any help.
> 
0
Utf
1/8/2008 2:57:01 AM
Kate,

Thanks for letting us know the names of your table and field, that helps 
a lot.  However, I don't know what the error message says.

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> I am geeting an error. My table is named Addresses and my checkbox is named 
> IndividualReport.
> Here is my code:
> Private Sub Command239_Click()
>        If Me.IndividualReport = True Then
>         Me.IndividualReport = False
>     End If
> 'CurrentDb.Execute "UPDATE YourTable SET YourYesNoField = 0", dbFailOnError
> CurrentDb.Execute "UPDATE Addresses SET IndividualReport = 0", dbFailOnError
> End Sub
> 
> I don't know any code.
> Thanks 
> 
0
Steve
1/8/2008 3:05:41 AM
When I click on command button I Get This Error.

Run-Time Error 3061
Too few parameters
Expected 1

Thanks for helping.
-- 
Kate
Just learning to use access


"Steve Schapel" wrote:

> Kate,
> 
> Thanks for letting us know the names of your table and field, that helps 
> a lot.  However, I don't know what the error message says.
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Kate wrote:
> > I am geeting an error. My table is named Addresses and my checkbox is named 
> > IndividualReport.
> > Here is my code:
> > Private Sub Command239_Click()
> >        If Me.IndividualReport = True Then
> >         Me.IndividualReport = False
> >     End If
> > 'CurrentDb.Execute "UPDATE YourTable SET YourYesNoField = 0", dbFailOnError
> > CurrentDb.Execute "UPDATE Addresses SET IndividualReport = 0", dbFailOnError
> > End Sub
> > 
> > I don't know any code.
> > Thanks 
> > 
> 
0
Utf
1/8/2008 3:16:01 AM
Thanks Kate.  Well, you can remove the original code.  So just leave the 
one line of code:
    Private Sub Command239_Click()
       CurrentDb.Execute "UPDATE Addresses SET IndividualReport = 0", 
dbFailOnError
    End Sub

And then, can you please double check and make quite sure that the name 
of the field in the Addresses table is IndividualReport and that you 
have it 100% correctly spelt in the code, and the same for the name of 
the table.

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> When I click on command button I Get This Error.
> 
> Run-Time Error 3061
> Too few parameters
> Expected 1
> 
> Thanks for helping.
0
Steve
1/8/2008 3:44:00 AM
Thanks Steve,
It is working now. There was a space between Individual & Report ,so I put 
it in brackets.  It is a little slow updating 30 second or so, but a lot 
faster than manually unchecking all of them. One more question if you don't 
mind. I have a checkbox for single & one for married. I would like to make 
sure if one is checked the other can't be. Would something like
 If Single=true then Married=false
Should you use true or -1 or false for 0
Thanks again.


-- 
Kate
Just learning to use access


"Steve Schapel" wrote:

> Thanks Kate.  Well, you can remove the original code.  So just leave the 
> one line of code:
>     Private Sub Command239_Click()
>        CurrentDb.Execute "UPDATE Addresses SET IndividualReport = 0", 
> dbFailOnError
>     End Sub
> 
> And then, can you please double check and make quite sure that the name 
> of the field in the Addresses table is IndividualReport and that you 
> have it 100% correctly spelt in the code, and the same for the name of 
> the table.
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Kate wrote:
> > When I click on command button I Get This Error.
> > 
> > Run-Time Error 3061
> > Too few parameters
> > Expected 1
> > 
> > Thanks for helping.
> 
0
Utf
1/9/2008 2:15:01 AM
Kate,

I can't imagine why the update is so slow.  Even if you had millions of 
records and you running the database on a very old machine with 
insufficient memory, 30 seconds is outside the realms of fantasy.

As for the Married/Single, basically this is a design flaw.  Are you 
able to consider a change to your table/form structure?  You should just 
have one field for Marital Status.

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> Thanks Steve,
> It is working now. There was a space between Individual & Report ,so I put 
> it in brackets.  It is a little slow updating 30 second or so, but a lot 
> faster than manually unchecking all of them. One more question if you don't 
> mind. I have a checkbox for single & one for married. I would like to make 
> sure if one is checked the other can't be. Would something like
>  If Single=true then Married=false
> Should you use true or -1 or false for 0
> Thanks again.
> 
> 
0
Steve
1/10/2008 6:43:16 PM
I am running it on a P4 2.4 with 1 gig Memory. There are less than 200 
records in it.  I have realized now I should have used a group with option 
buttons, but I am querying the married checkbox for a mail merge. Here is my 
query: Married is the checkbox. What I want is to put an & sign between 
firstname & spoure if married.
This works:
Name: IIf([Married]=-1,[FirstName] & " & " & [SpouseName],[FirstName])

I tried this it doesn't work.
Name1: IIf([SpouseName]=Null,[FirstName],[FirstName] & " & " & [SpouseName])
This puts an & sign after the single and married person.

 Like I said before I don't know alot about seting up a database correctly. 
I am just trying to help out the church.

Thanks again for your replys.
-- 
Kate
Just learning to use access


"Steve Schapel" wrote:

> Kate,
> 
> I can't imagine why the update is so slow.  Even if you had millions of 
> records and you running the database on a very old machine with 
> insufficient memory, 30 seconds is outside the realms of fantasy.
> 
> As for the Married/Single, basically this is a design flaw.  Are you 
> able to consider a change to your table/form structure?  You should just 
> have one field for Marital Status.
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Kate wrote:
> > Thanks Steve,
> > It is working now. There was a space between Individual & Report ,so I put 
> > it in brackets.  It is a little slow updating 30 second or so, but a lot 
> > faster than manually unchecking all of them. One more question if you don't 
> > mind. I have a checkbox for single & one for married. I would like to make 
> > sure if one is checked the other can't be. Would something like
> >  If Single=true then Married=false
> > Should you use true or -1 or false for 0
> > Thanks again.
> > 
> > 
> 
0
Utf
1/10/2008 10:31:05 PM
Kate,

No worries, I'm not expecting you to be an expert. :-)  Just wondering 
whether you could change it, that's all.

The amount of time a line of code such as we discussed 
CurrentDb.Execute... would take to run on your computer would be 
measured in microseconds - it would be so quick you couldn't detect it. 
  So there must be something else causing this 30 second whatever it is.

"[SpouseName]=Null" does not compute.  The syntax should be:
IIf([SpouseName] Is Null, ...
or:
IIf(IsNull([SposeName]), ...

Using the existence of data in SpouseName as the test would be more 
reliable, and therefore the value of the Married and Single fields 
becomes irrelevant, right?

Another way to write in might be like this:
Name1: [FirstName] & IIf(IsNull([SpouseName]),""," & " & [SpouseName])

Here's how I would do it myself, neater but perhaps less inuitive:
Name1: [FirstName] & " & "+[SpouseName]

By the way, as an aside, 'name' is a Reserved Word (i.e. has a special 
meaning) in Access, and as such should not be used as the name of a 
field or control.

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> I am running it on a P4 2.4 with 1 gig Memory. There are less than 200 
> records in it.  I have realized now I should have used a group with option 
> buttons, but I am querying the married checkbox for a mail merge. Here is my 
> query: Married is the checkbox. What I want is to put an & sign between 
> firstname & spoure if married.
> This works:
> Name: IIf([Married]=-1,[FirstName] & " & " & [SpouseName],[FirstName])
> 
> I tried this it doesn't work.
> Name1: IIf([SpouseName]=Null,[FirstName],[FirstName] & " & " & [SpouseName])
> This puts an & sign after the single and married person.
> 
>  Like I said before I don't know alot about seting up a database correctly. 
> I am just trying to help out the church.
> 
> Thanks again for your replys.
0
Steve
1/11/2008 2:28:30 AM
Steve,
Thanks again for the help. I just replace the = sign with IS and it works. I 
was really close. I did a test and checked some boxes and pressed the command 
button then moved to a another record and the box was unchecked. I moved to 
other records as fast as I could and they were all unchecked, all but the 
record I was on. Does there need to be a refresh on this somewhere. If you 
stay on the same record it looks like it isn't doing anything. Also on the 
married and Single should I use an option button instead of the checkboxes. 
You have been a great help.


-- 
Kate
Just learning to use access


"Steve Schapel" wrote:

> Kate,
> 
> No worries, I'm not expecting you to be an expert. :-)  Just wondering 
> whether you could change it, that's all.
> 
> The amount of time a line of code such as we discussed 
> CurrentDb.Execute... would take to run on your computer would be 
> measured in microseconds - it would be so quick you couldn't detect it. 
>   So there must be something else causing this 30 second whatever it is.
> 
> "[SpouseName]=Null" does not compute.  The syntax should be:
> IIf([SpouseName] Is Null, ...
> or:
> IIf(IsNull([SposeName]), ...
> 
> Using the existence of data in SpouseName as the test would be more 
> reliable, and therefore the value of the Married and Single fields 
> becomes irrelevant, right?
> 
> Another way to write in might be like this:
> Name1: [FirstName] & IIf(IsNull([SpouseName]),""," & " & [SpouseName])
> 
> Here's how I would do it myself, neater but perhaps less inuitive:
> Name1: [FirstName] & " & "+[SpouseName]
> 
> By the way, as an aside, 'name' is a Reserved Word (i.e. has a special 
> meaning) in Access, and as such should not be used as the name of a 
> field or control.
> 
> -- 
> Steve Schapel, Microsoft Access MVP
> 
> Kate wrote:
> > I am running it on a P4 2.4 with 1 gig Memory. There are less than 200 
> > records in it.  I have realized now I should have used a group with option 
> > buttons, but I am querying the married checkbox for a mail merge. Here is my 
> > query: Married is the checkbox. What I want is to put an & sign between 
> > firstname & spoure if married.
> > This works:
> > Name: IIf([Married]=-1,[FirstName] & " & " & [SpouseName],[FirstName])
> > 
> > I tried this it doesn't work.
> > Name1: IIf([SpouseName]=Null,[FirstName],[FirstName] & " & " & [SpouseName])
> > This puts an & sign after the single and married person.
> > 
> >  Like I said before I don't know alot about seting up a database correctly. 
> > I am just trying to help out the church.
> > 
> > Thanks again for your replys.
> 
0
Utf
1/11/2008 3:56:13 AM
Kate,

Ah, yes, if you are running the update of the Addresses table from a 
form that is based on the Addresses table, then in order to see the 
results of the update you will probably need to do like this:
    Me.Requery
.... after the CurrentDb.Execute... line.

It doesn't matter whether you use an option button or a checkbox.  The 
functionality is identical.  The issue I was referring to before, if you 
are interested, is different.  It is the problem of there being 2 
separate fields for Married and Single.  So you have a checkbox bound to 
the Married field which is a Yes/No field, and you have another checkbox 
bound to the Single field, which is a Yes/No data type.  This is known 
as the "fields as data trap".  "Married" and "Single" are data, relating 
to a more general data attribute which we could call Marital Status. 
Depending on your database's purpose, you might even allow other 
options, such as Divorced, Widowed, etc.  But they are all mutually 
exclusive.  So the "correct" database design would be to just have one 
field, for Marital Status.  Now, once you make that decision, the way to 
record it you have a choice.  It could be a Text data type, and you 
enter the data on your form via a combobox which lists all the possible 
marital status options, including "married" or "single".  Or you could 
make it a Number data type field, and you can enter the data via an 
Option Group on your form.  In the case of an Option Group, the group 
itself is bound to the Marital Status field, and the Option Group 
contains a checkbox (or option button, doesn't matter) for each 
allowable option, such as married, single, etc., whereupon you can only 
ever select one or the other.  Hope that helps. :-)

-- 
Steve Schapel, Microsoft Access MVP

Kate wrote:
> Steve,
> Thanks again for the help. I just replace the = sign with IS and it works. I 
> was really close. I did a test and checked some boxes and pressed the command 
> button then moved to a another record and the box was unchecked. I moved to 
> other records as fast as I could and they were all unchecked, all but the 
> record I was on. Does there need to be a refresh on this somewhere. If you 
> stay on the same record it looks like it isn't doing anything. Also on the 
> married and Single should I use an option button instead of the checkboxes. 
> You have been a great help.
> 
> 
0
Steve
1/11/2008 4:53:09 AM
Reply:

Similar Artilces:

How do I put input boxes and sumbit buttons in?
How do I put input boxes and sumbit buttons in excel vba? I am trying to make a address book manually using Excel VBA. Is there a way I can record multiple information into Excel after submitting info. All i have so far is being able to submit one bit of information into excel but I dont think it will stay if I save it. Like is there a way I can group multiple address information using excel VBA? If so how? What you want to do is not clear. Please post back and give us a step-by-step procedure of what you want to do and what you want Excel to do. HTH Otto "mikstr14" <m...

print preview command in Excel
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I just upgraded to office 2008 for Mac and can not find the &quot;print preview&quot; command in Excel I had in my previous version and that is available in Word 2008. Was it removed? > On 11/4/09 8:43 AM, in article 59b7feef.-1@webcrossing.caR9absDaxw, <br> > &quot;sprint1005@officeformac.com&quot; wrote: <br> > <br> > > Version: 2008 <br> > > Operating System: Mac OS X 10.6 (Snow Leopard) <br> > > <br> > > I just upgraded to office ...

macros will not assign to buttons
Help! I cannot assign macros to my custom buttons. The dialog box appears and I can select a macro but it does not save to the button. I believe this is related to another problem I had - which was my personal.xls file did not load on start even though it was in the xl start folder. I fixed that - it was disabled by excel which I fixed by going to about excel - disabled files and selecting enable. Now personal.xls loads - but the macros will not assign. What type of button? From Tools>Customize>Commands>Macros? These customizations are stored in a file named Excel(x).xlb wher...

ESEutil commands
I need a step by step guide on using eseutil. I need to learn how to use this tool to commit the logs to the database On Tue, 23 Nov 2004 18:09:02 -0800, "Ed" <Ed@discussions.microsoft.com> wrote: >I need a step by step guide on using eseutil. I need to learn how to use this >tool to commit the logs to the database eseutil/? A full online backup of the store will commit the logs. What exactly are you trying to accomplish? I have another site that will not have a backup solution in place until next month so i would to know how to flush the logs using this utility ...

Creating custom buttons #2
Hello, I would like to create screens of buttons so that the operators of the register can simply press a button to add an item for a sale. The system will be used at the end of a cafeteria type food line and I need to speed up the check out process. What I am thinking is having 3 buttons on one screen, Hot Food, Drinks, and Candy/Snacks. Then when the cashier presses Hot Food, another screen comes up that displays 1 button for each of the 16 current Hot Food items. When 1 of those items is selected, the Hot Food button screen should remain open until the user presses a Back button. ...

Command Button #4
I'm trying to create a command button to clear filters in my spreadsheet. I don't know how to write the commands, but can recored a macro and run it fine. I tried pasting that macro into the button....and I had it working then messed it up. Now when I click on the button, nothing happens. The code currently associated to the button is below. I really don't want Criteria1 to = 'Reject', but the one time the button worked if no filter was set and the button clicked, an error was returned. The only way I could make it work was to force a filter as part of the macro. How...

Append Records without Duplicates
I have a table with several columns. Twice a day, I need to add (backup) the records to another table. But I don't want duplicates. So I have to have a module that looks at the last Date and End Time so I don't get duplicates in my new table. Any help would be great! Index Date End Time 1 1100520 211008 2 1100520 211029 3 1100520 211031 4 1100521 211031 5 1100521 211031 6 1100522 211046 7 1100522 211046 8 1100522 211046 9 1100522 211054 Jaimeta wrote: >I have a table with several columns. Twice a day, I need to add (backup) the >records to another ta...

command
how do you use command. A lot of computer people use it but how do we use it? Aaron You've reached a newsgroup dedicated to supporting the use of Microsoft Access, a relational database product. I don't see anything in your post that suggests you are asking about MS Access. Please post to a newsgroup that supports the area covered by your post. Regards Jeff Boyce Microsoft Office/Access MVP "aaron" <aaron_t_d@hotmail.com> wrote in message news:78CB1423-55B3-40A1-8BF5-D4615E816057@microsoft.com... > how do you use command. A lot of computer people use i...

Set Increment on Spin Button to 0.1
I'm using a spin button from the control toolbar to increase the value in a cell. the min value i want is 0 the maximum is 2 but i want it to increase by 0.1 in the properties this doesn't seem to be allowed help!!!! Thanx Mark Mark, Here is one way. Link your spinbutton to an unused cell (I use) A15. Set the max to 20. Then in code, set the real cell's value like so Private Sub SpinButton1_SpinUp() Range("A16").Value = Range("A15").Value / 10 End Sub Private Sub SpinButton1_SpinDown() Range("A16").Value = Range("A15").Valu...

command boxes from menu
I was working on word 2003, I had copied a portion of an online ebook to paste onto a new document, when I did right click to paste it on the doc. the command box appears outlined, no word commands, it's like a ghost. I then went to the menu at the top to Edit and find paste to do it from there and the same thing appeared; an outline of the command box, no word commands, it's like a ghost. I tried to pretend the words were there just not visible and moved my cursor to the position in which I thought paste was and clicked but nothing happened. Has anybody ever had this ...

XML Appropriate for Byte Oriented Data Records
Googling and GoogleGrouping for "XML Byte Data Records" and similar bring back millions of hits about character sets. ;-) Is XML appropriate for specifying and validating byte-oriented data? Can it be used for bit masking validation? Comments and URLs appreciated. Thanks. -- Mark Mark Jerde wrote: > Is XML appropriate for specifying and validating byte-oriented data? XML is a text format, at least in XML 1.0 certain control characters are not allowed, and even in XML 1.1 those are only allowed as numeric character references I think. Thus if you want to store ...

command
still learning of the sql command HOW TO DISABLE XP_CMDSHELL AND DISABLE BOTH MAIL PROCEDURES ...

remove button
How can I remove the Save and Close, or Save and New button on a phone call activity? Hi Troy, You could find out the location of the buttons via Javascript and then hide these buttons. Though this is relatively hard to do and unsupported, it can be done. Another approach, which in my opinion is a lot better, would be to remove the rights for users to create, delete and eventually update the entity phone call. You can do this in the security roles in the settings section. Hope this helps, -- Ronald Lemmen - MSCRM MVP Avanade Netherlands http://ronaldlemmen.blogspot.com/ "Troyz...

Adding a command to a picture
I have inserted a picture onto my form and in the Event / double click set up a macro to close the form however when i double click on my picture nothing is happening - help!! On Thu, 3 Jun 2010 06:02:22 -0700, casi <casi@discussions.microsoft.com> wrote: One suggestion would be to temporarily add a button to your form, and from the button wizard select the option to close the form. Then look behind the scenes what was generated, and implement your image_doubleclick the same way. -Tom. Microsoft Access MVP >I have inserted a picture onto my form and in the Event ...

Command Handler
Hi Guys, I have a context menu and menu handler. I know how to acheive what is needed,but I am wanting to know if there is a better way to do this. When the user right clicks on a view, I get the OnRButtonDown(...), there I show the context menu. I have a command handler for the menuitems in the context menu also, clicking which will take me to the handler. What I want is to know is the point where the context menu popped up inside the command handler. Is there a way? Or Is caching the CPoint in OnRButtonDown and using it in the command handler the only way? Thanks Vipin &...

Userform Command Button
In a Userform, I have multiple command buttons. For example: D1_Click D2_Click Depending on another event that occurs, I want to calculate in code the button name that I will be triggering the click event and then trigger the event. For example Application.Run "D" & i & "_Click" with i being the value of 1 or 2. Application.Run doesn't appear to work in the Userform. Thanks Steve Maybe it's because most subroutines in a userform module are "Private"??? Have you tried changing the "Private" prefix to "...

MCI recording silence, but Sound Recorder records OK.
Hello everybody, This code using MCI is working fine in many PCs, but one (in which only a long silence is recorded): // // OPEN // sMsg.Format("open new type waveaudio alias %s", m_sWavName); mciError = mciSendString(sMsg, lpszReturnString, 256, NULL); (...) sMsg.Format("status %s mode wait", m_sWavName); mciError = mciSendString(sMsg, lpszReturnString, 256, NULL); (...) sMsg.Format("set %s format tag PCM", m_sWavName); mciError = mciSendString(sMsg, lpszReturnString, 256, NULL); (...) sMsg.Format("set %s channels 1", m_sWavName); mciE...

Make lines on a graph appear with a button
All, I need to create a graph with 40 or so lines graphed but only one up o the graph at a time with the use of buttons. I would really appreciat a hand, I am very new to this level of Excel. Thanks -- Message posted from http://www.ExcelForum.com Select all the data, and create a line chart Select a cell in the table Choose Data>Filter>AutoFilter From the dropdown list in one of the heading cells, select an item The chart will display the data for that item geistritter < wrote: > I need to create a graph with 40 or so lines graphed but only one up on > the graph at a tim...

Sales for outlook folders and buttons.
ok, so I've done this many, many times.... .. Go to Tools | Options. 2. Click on the Other tab and click on the Advanced Options button. 3. Click on the COM Add-Ins button. 4. Highlight the Microsoft CRM Add-In (Note the location of the crmaddin.dll) and then click the remove button. 5. Click OK until back at the Outlook window. 6. Exit Outlook. 7. Launch Outlook and go back to the COM Add-Ins window (steps 1 - 3). 8. Click the Add button and navigate to the location of the crmaddin.dll file (from Step 4). 9. Click OK to get back to the Outlook Window. 10. Exit Outlook and...

Print withoutshowing a comand button
I am trying to print a spreadsheet but I do not want the comand button show on the paper copy. Is there a way to hide it in the printing process. les, view, toolbars, control toolbox, click on the design mode button then right click on the button and properties, there is an option there for print object, change to false, click on design mode again and close the tool bar -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "les&quo...

command buttons
Greetings, I have two command buttons A and B which are connected to subforms on the main form.I have a table"Client" and field "A/B". My goal is when I click amdA I want the field "A/B" show A, whe I click cmdB I field "A/B" will show B. If any solution? For me it's puzzle.Thx. -- Patric Patric, Assuming that the control you want to populate on the main form is named 'A/B', put the following code in the On Click event for button A: Forms![Name of main form]![Name of sub form control].Form![A/B] = A In the On Click event for button B:...

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

run command to istall printers?
I have the following commands that I can type at the dos prompt that will install a printer into all users profiles on the computer. rundll32 printui.dll,PrintUIEntry /ga /n=94\\prnsrv\Second Floor Printer=94 net stop spooler net start spooler How can I put this into a vbs script so that I use it to run on peoples computers rather than typing it in. Thanks. Steve wrote: I have the following commands that I can type at the dos prompt that will install a printer into all users profiles on the computer. rundll32 printui.dll,PrintUIEntry /ga /n�\\prnsrv\Second Floor ...

Record Lock Problem
Hi All, I have a databse that runs queries against an ODBC source throughout the day and night. I am having an issue where a query will run at night and throw an error message about not being able to append due to record lock. What could be causing this? Is there a way to ignore the message? Any suggestions to avoid this? Thanks in advamce for the help! You could: Run the queries from code which traps the error Writes a message (including time error message etc) to a table Then resumes at the point following the error [On Error goto xxx :xxx Write error to errors table resume next ] ...

make autofilter buttons more discernable?
My eyesight is getting worse and I'm having trouble discerning the blu or black arrow when using autofilter. Besides increasing the vie percentage (not desirable), is there anything I can do -- wolfpack9 ----------------------------------------------------------------------- wolfpack95's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=9 View this thread: http://www.excelforum.com/showthread.php?threadid=38869 Debra Dalgleish posted a response from Tom Ogilvy to get the filter criteria: http://groups.google.co.uk/group/microsoft.public.excel.worksheet.funct...