By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Evaluating a group of combo boxes

P: n/a
I want to look at the values of six combo boxes. If any of the boxes
are not null, I want to change the value of a separate text box. How
can I look at all of them at once?

Thanks in advance.

Troy Lee
Aug 24 '08 #1
Share this Question
Share on Google+
8 Replies


P: n/a
tr******@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of the
boxes are not null, I want to change the value of a separate text
box. How can I look at all of them at once?

Thanks in advance.

Troy Lee
If you wish to look at them at once, you open your eyes. :-)

If you wish to evaluate their contents using Visual basic in the
forms code module, you would put code in the event that is triggered
when you wish to evaluate them. you could simply set a variable
bAll_Are_Null = (len("" & me.combo1 & me.combo2 & me.combo3 ....)=0)

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 24 '08 #2

P: n/a
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of the
boxes are not null, I want to change the value of a separate text
box. How can I look at all of them at once?
Thanks in advance.
Troy Lee

If you wish to look at them at once, you open your eyes. :-)

If you wish to evaluate their contents using Visual basic in the
forms code module, you would put code in the event that is triggered
when you wish to evaluate them. you could simply set a variable
bAll_Are_Null = (len("" & me.combo1 & me.combo2 & me.combo3 ....)=0)

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Thank you so much. I appreciate the humor. I am a n00b so some things
that are so painfully obvious to some are enigmas to me.

Troy Lee
Aug 24 '08 #3

P: n/a
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of the
boxes are not null, I want to change the value of a separate text
box. How can I look at all of them at once?
Thanks in advance.
Troy Lee

If you wish to look at them at once, you open your eyes. :-)

If you wish to evaluate their contents using Visual basic in the
forms code module, you would put code in the event that is triggered
when you wish to evaluate them. you could simply set a variable
bAll_Are_Null = (len("" & me.combo1 & me.combo2 & me.combo3 ....)=0)

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Bob,
This is what I tried. I put this code in the click event of my filter
button.

intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart & Me.cboReceiveEnd
& Me.cboQAStart & Me.cboQAEnd & Me.cboShipStart & Me.cboShipEnd) = 0)

If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If

I'm not sure if I am doing this right. I can't get the combo box to
take on this new value "All Units". Any ideas? Am I using the variable
right?
Aug 24 '08 #4

P: n/a
tr******@comcast.net wrote in
news:8da720b3-fcaf-4dbb-b88f-b5c0b80aa381
@k7g2000hsd.googlegroups.com
:
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
>troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of the
boxes are not null, I want to change the value of a separate
text box. How can I look at all of them at once?
Thanks in advance.
Troy Lee

If you wish to look at them at once, you open your eyes. :-)

If you wish to evaluate their contents using Visual basic in the
forms code module, you would put code in the event that is
triggered when you wish to evaluate them. you could simply set a
variable bAll_Are_Null = (len("" & me.combo1 & me.combo2 &
me.combo3 ....)=0)

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**

Bob,
This is what I tried. I put this code in the click event of my
filter button.

intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart &
Me.cboReceiveEnd & Me.cboQAStart & Me.cboQAEnd & Me.cboShipStart &
Me.cboShipEnd) = 0)

If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If

I'm not sure if I am doing this right. I can't get the combo box
to take on this new value "All Units". Any ideas? Am I using the
variable right?
Not knowing your form, I need to ask if you have a combobos named
me.cborecordsource, or whether you really mean
Me.cboReceiveStart.Recordsource = "All Units"
Me.cboReceiveEnd.Recordsource = "All Units"
me.....
through all the comboboxes.
--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 24 '08 #5

P: n/a
On Aug 24, 7:02 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:8da720b3-fcaf-4dbb-b88f-b5c0b80aa381
@k7g2000hsd.googlegroups.com
:
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of the
boxes are not null, I want to change the value of a separate
text box. How can I look at all of them at once?
Thanks in advance.
Troy Lee
If you wish to look at them at once, you open your eyes. :-)
If you wish to evaluate their contents using Visual basic in the
forms code module, you would put code in the event that is
triggered when you wish to evaluate them. you could simply set a
variable bAll_Are_Null = (len("" & me.combo1 & me.combo2 &
me.combo3 ....)=0)
--
Bob Quintal
PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Bob,
This is what I tried. I put this code in the click event of my
filter button.
intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart &
Me.cboReceiveEnd & Me.cboQAStart & Me.cboQAEnd & Me.cboShipStart &
Me.cboShipEnd) = 0)
If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If
I'm not sure if I am doing this right. I can't get the combo box
to take on this new value "All Units". Any ideas? Am I using the
variable right?

Not knowing your form, I need to ask if you have a combobos named
me.cborecordsource, or whether you really mean
Me.cboReceiveStart.Recordsource = "All Units"
Me.cboReceiveEnd.Recordsource = "All Units"
me.....
through all the comboboxes.

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
No, I really have a combo box named cboRecordSource- probably not very
smart, huh?
Aug 25 '08 #6

P: n/a
tr******@comcast.net wrote in
news:35b47971-6687-4178-a431-1efd73714d11
@e53g2000hsa.googlegroups.co
m:
On Aug 24, 7:02 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
>troy_...@comcast.net wrote in
news:8da720b3-fcaf-4dbb-b88f-b5c0b80aa381
@k7g2000hsd.googlegroups.com
:
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of
the boxes are not null, I want to change the value of a
separate text box. How can I look at all of them at once?
Thanks in advance.
Troy Lee
>If you wish to look at them at once, you open your eyes. :-)
>If you wish to evaluate their contents using Visual basic in
the forms code module, you would put code in the event that is
triggered when you wish to evaluate them. you could simply set
a variable bAll_Are_Null = (len("" & me.combo1 & me.combo2 &
me.combo3 ....)=0)
>--
Bob Quintal
>PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Bob,
This is what I tried. I put this code in the click event of my
filter button.
intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart &
Me.cboReceiveEnd & Me.cboQAStart & Me.cboQAEnd &
Me.cboShipStart & Me.cboShipEnd) = 0)
If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If
I'm not sure if I am doing this right. I can't get the combo
box to take on this new value "All Units". Any ideas? Am I
using the variable right?

Not knowing your form, I need to ask if you have a combobos named
me.cborecordsource, or whether you really mean
Me.cboReceiveStart.Recordsource = "All Units"
Me.cboReceiveEnd.Recordsource = "All Units"
me.....
through all the comboboxes.

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**

No, I really have a combo box named cboRecordSource- probably not
very smart, huh?
It's unusual, although it may be the smartest name for the box.
Because we cannot see your form, we need to guess sometimes.

Now when you set this combobox to "all Units", do you get an error
message? if yes, is the message immediate or does it only appear
when you try to save the record?

What is the rowSource of the this combo box, and what is its
recordsource? is limit to list set to yes?

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 25 '08 #7

P: n/a
On Aug 25, 6:00 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:35b47971-6687-4178-a431-1efd73714d11
@e53g2000hsa.googlegroups.co
m:
On Aug 24, 7:02 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:8da720b3-fcaf-4dbb-b88f-b5c0b80aa381
@k7g2000hsd.googlegroups.com
:
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any of
the boxes are not null, I want to change the value of a
separate text box. How can I look at all of them at once?
Thanks in advance.
Troy Lee
If you wish to look at them at once, you open your eyes. :-)
If you wish to evaluate their contents using Visual basic in
the forms code module, you would put code in the event that is
triggered when you wish to evaluate them. you could simply set
a variable bAll_Are_Null = (len("" & me.combo1 & me.combo2 &
me.combo3 ....)=0)
--
Bob Quintal
PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Bob,
This is what I tried. I put this code in the click event of my
filter button.
intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart &
Me.cboReceiveEnd & Me.cboQAStart & Me.cboQAEnd &
Me.cboShipStart & Me.cboShipEnd) = 0)
If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If
I'm not sure if I am doing this right. I can't get the combo
box to take on this new value "All Units". Any ideas? Am I
using the variable right?
Not knowing your form, I need to ask if you have a combobos named
me.cborecordsource, or whether you really mean
Me.cboReceiveStart.Recordsource = "All Units"
Me.cboReceiveEnd.Recordsource = "All Units"
me.....
through all the comboboxes.
--
Bob Quintal
PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
No, I really have a combo box named cboRecordSource- probably not
very smart, huh?

It's unusual, although it may be the smartest name for the box.
Because we cannot see your form, we need to guess sometimes.

Now when you set this combobox to "all Units", do you get an error
message? if yes, is the message immediate or does it only appear
when you try to save the record?

What is the rowSource of the this combo box, and what is its
recordsource? is limit to list set to yes?

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Hey Bob,
Once again, thanks for the help.

I do not get error messages, the combo box just doesn't change. The
box is unbound and its row source is "All Unshipped Units";"All Units
Thru Final QA";"All Units".

I have 3 sets of 2 combo boxes that hold start and end dates. If any
of these boxes are filled in, 99.99% of the time the user wants to do
an historical search. The box cboRecordSource defaults to "All
Unshipped Units". These are active units.

I think you were leading me down the right road with the Len function.
I just didn't know how to apply it, or if I needed to delimit the
arguments included in the function with ## since these are date
values.

This is mostly to make it easy for the user, so they don't have to
manually change the cboRecordSource to "All Units" when I can
anticipate their need for an historical search.

Hope this clears it up. Thanks.

Troy Lee
Aug 25 '08 #8

P: n/a
tr******@comcast.net wrote in
news:b0726a2c-f3b4-4993-b496-
e8**********@y38g2000hsy.googlegroups.co
m:
On Aug 25, 6:00 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
>troy_...@comcast.net wrote in
news:35b47971-6687-4178-a431-1efd73714d11
@e53g2000hsa.googlegroups.co
m:
On Aug 24, 7:02 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
troy_...@comcast.net wrote in
news:8da720b3-fcaf-4dbb-b88f-b5c0b80aa381
@k7g2000hsd.googlegroups.com
:
On Aug 24, 4:47 pm, Bob Quintal <rquin...@sPAmpatico.ca>
wrote:
troy_...@comcast.net wrote in
news:b64d1c3b-7edf-43b8-a49a-35dac712cd5e@
2g2000hsn.googlegroups.com:
I want to look at the values of six combo boxes. If any
of the boxes are not null, I want to change the value of
a separate text box. How can I look at all of them at
once?
Thanks in advance.
Troy Lee
>If you wish to look at them at once, you open your eyes.
:-)
>If you wish to evaluate their contents using Visual basic
in the forms code module, you would put code in the event
that is triggered when you wish to evaluate them. you could
simply set a variable bAll_Are_Null = (len("" & me.combo1 &
me.combo2 & me.combo3 ....)=0)
>--
Bob Quintal
>PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
Bob,
This is what I tried. I put this code in the click event of
my filter button.
intAll_CBs_Are_Null = (Len("" & Me.cboReceiveStart &
Me.cboReceiveEnd & Me.cboQAStart & Me.cboQAEnd &
Me.cboShipStart & Me.cboShipEnd) = 0)
If intAll_CBs_Are_Null 0 Then
Me.cboRecordSource = "All Units"
End If
I'm not sure if I am doing this right. I can't get the combo
box to take on this new value "All Units". Any ideas? Am I
using the variable right?
>Not knowing your form, I need to ask if you have a combobos
named me.cborecordsource, or whether you really mean
Me.cboReceiveStart.Recordsource = "All Units"
Me.cboReceiveEnd.Recordsource = "All Units"
me.....
through all the comboboxes.
>--
Bob Quintal
>PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**
No, I really have a combo box named cboRecordSource- probably
not very smart, huh?

It's unusual, although it may be the smartest name for the box.
Because we cannot see your form, we need to guess sometimes.

Now when you set this combobox to "all Units", do you get an
error message? if yes, is the message immediate or does it only
appear when you try to save the record?

What is the rowSource of the this combo box, and what is its
recordsource? is limit to list set to yes?

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**

Hey Bob,
Once again, thanks for the help.

I do not get error messages, the combo box just doesn't change.
The box is unbound and its row source is "All Unshipped
Units";"All Units Thru Final QA";"All Units".

I have 3 sets of 2 combo boxes that hold start and end dates. If
any of these boxes are filled in, 99.99% of the time the user
wants to do an historical search. The box cboRecordSource defaults
to "All Unshipped Units". These are active units.

I think you were leading me down the right road with the Len
function. I just didn't know how to apply it, or if I needed to
delimit the arguments included in the function with ## since these
are date values.

This is mostly to make it easy for the user, so they don't have to
manually change the cboRecordSource to "All Units" when I can
anticipate their need for an historical search.

Hope this clears it up. Thanks.

Troy Lee
The box should change. Try a test with an If True then case, to see
if it does.

One reason it would not work is that the event containing the code
is not fired. Which event did you use?

The len() thing will work without the Date delimiters, because the
concatenation operation will automatically convert a non-blank date
into a string.

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 26 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.