Creating a vb command that allows you to check specific boxes yes

L

linat

Hi,

I am creating a subform in the access database that I am creating that will
allow an order entry person to check off all the given products in a group. I
know I need to write a vb code through a command button --- on click event
procedure to enable a check all boxes functions so he or she doesn't have to
check all of them manually. I am new at this and am not sure how to write
the command.

Can anyone help me please?

Thanks,

Lina
 
D

Douglas J Steele

Me!Checkbox1 = True
Me!Checkbox2 = True
Me!Checkbox3 = True

etc.

If you want to check all check boxes on a form, you can use:

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is CheckBox Then
ctlCurr = True
End If
Next ctlCurr

or

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If ctlCurr.ControlType = acCheckBox Then
ctlCurr = True
End If
Next ctlCurr
 
L

linat via AccessMonster.com

Thanks so much worked like a charm!!!! : )
Douglas said:
Me!Checkbox1 = True
Me!Checkbox2 = True
Me!Checkbox3 = True

etc.

If you want to check all check boxes on a form, you can use:

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is CheckBox Then
ctlCurr = True
End If
Next ctlCurr

or

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If ctlCurr.ControlType = acCheckBox Then
ctlCurr = True
End If
Next ctlCurr
[quoted text clipped - 10 lines]
 
L

linat via AccessMonster.com

One more quick question: I would need to change up that logic to get it to
select just a certain group of three boxes right? Listing the box names...is
that correct.
Me!Checkbox1 = True
Me!Checkbox2 = True
Me!Checkbox3 = True

etc.

If you want to check all check boxes on a form, you can use:

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is CheckBox Then
ctlCurr = True
End If
Next ctlCurr

or

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If ctlCurr.ControlType = acCheckBox Then
ctlCurr = True
End If
Next ctlCurr
[quoted text clipped - 10 lines]
 
D

Douglas J Steele

Take a look at my June, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access" for some ideas of how you can group specific
controls to do this sort of thing. There's also a little in the October,
2004 column.

You can download the columns (and sample databases) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


linat via AccessMonster.com said:
One more quick question: I would need to change up that logic to get it to
select just a certain group of three boxes right? Listing the box names...is
that correct.
Me!Checkbox1 = True
Me!Checkbox2 = True
Me!Checkbox3 = True

etc.

If you want to check all check boxes on a form, you can use:

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If TypeOf ctlCurr Is CheckBox Then
ctlCurr = True
End If
Next ctlCurr

or

Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If ctlCurr.ControlType = acCheckBox Then
ctlCurr = True
End If
Next ctlCurr
[quoted text clipped - 10 lines]
 
L

linat via AccessMonster.com

Thank you sooooooo much.... I am so new at this don't mean to be a pest.
Douglas said:
Take a look at my June, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access" for some ideas of how you can group specific
controls to do this sort of thing. There's also a little in the October,
2004 column.

You can download the columns (and sample databases) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html
One more quick question: I would need to change up that logic to get it to
select just a certain group of three boxes right? Listing the box names...is
[quoted text clipped - 31 lines]
 
L

linat via AccessMonster.com

Hey Doug,

Do any of your papers cover list boxes? I am trying to link a pre-existing
product to the product line it goes to through a list box.

Thanks,

Lina
Take a look at my June, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access" for some ideas of how you can group specific
controls to do this sort of thing. There's also a little in the October,
2004 column.

You can download the columns (and sample databases) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html
One more quick question: I would need to change up that logic to get it to
select just a certain group of three boxes right? Listing the box names...is
[quoted text clipped - 31 lines]
 
D

Douglas J. Steele

Not sure I understand your question.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


linat via AccessMonster.com said:
Hey Doug,

Do any of your papers cover list boxes? I am trying to link a
pre-existing
product to the product line it goes to through a list box.

Thanks,

Lina
Take a look at my June, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access" for some ideas of how you can group specific
controls to do this sort of thing. There's also a little in the October,
2004 column.

You can download the columns (and sample databases) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html
One more quick question: I would need to change up that logic to get it
to
select just a certain group of three boxes right? Listing the box
names...is
[quoted text clipped - 31 lines]
 
L

linat via AccessMonster.com

Hey Doug,

I am working on a new database. I work for a printer company. One of the
things i need this to do is for a new machine take the supplies that are used
by pre-existing machines as well as the new one and match them up to the
other machines if any they use. I am using a check box to designate pre-
existing items. Someone suggested because I am working with a live data
feed for the information to use a list box that works off a query but I am
not sure where to begin and the bible doesn't cover this. I looked on msdn
and they are so complicated for someone who isn't knowledgeable.
Thanks,

Lina
Not sure I understand your question.
Hey Doug,
[quoted text clipped - 21 lines]
 
D

Douglas J. Steele

I don't think there's anything there that's applicable to your situation.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


linat via AccessMonster.com said:
Hey Doug,

I am working on a new database. I work for a printer company. One of the
things i need this to do is for a new machine take the supplies that are used
by pre-existing machines as well as the new one and match them up to the
other machines if any they use. I am using a check box to designate pre-
existing items. Someone suggested because I am working with a live data
feed for the information to use a list box that works off a query but I am
not sure where to begin and the bible doesn't cover this. I looked on msdn
and they are so complicated for someone who isn't knowledgeable.
Thanks,

Lina
Not sure I understand your question.
Hey Doug,
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top