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

Combo box bound column value

P: n/a
Hi,

I have a form with a combo box containing 4 columns of data.

The form also contains 3 print buttons where the goal is to open 3 different
reports according to the value in one of the columns of the combo box.

Since the bound column property determines which value to look at, how do I
change the bound column's value in an onClick event?

Regards,

Cindi

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Cindi Simonson wrote:
Hi,

I have a form with a combo box containing 4 columns of data.

The form also contains 3 print buttons where the goal is to open 3
different reports according to the value in one of the columns of the
combo box.

Since the bound column property determines which value to look at,
how do I change the bound column's value in an onClick event?

Regards,

Cindi


You don't need to. You can access any of the columns with this syntax...

Me.ComboBoxName.Column(n)

....where n is the zero-based ordinal of the column you want.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:36*************@individual.net...
Cindi Simonson wrote:
Hi,

I have a form with a combo box containing 4 columns of data.

The form also contains 3 print buttons where the goal is to open 3
different reports according to the value in one of the columns of the
combo box.

Since the bound column property determines which value to look at,
how do I change the bound column's value in an onClick event?

Regards,

Cindi


You don't need to. You can access any of the columns with this syntax...

Me.ComboBoxName.Column(n)

...where n is the zero-based ordinal of the column you want.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Thank you. Where exactly do I put that line of code or what do I associate
it with?

Currently, I'm using a separate button and query with
[FORMS]![nameofform]![SELECT] in the criteria to open a report based on the
value selected from a combo box. The combo box contains column 1=DeptID,
column 2 =ProgramID, column 3=CourseID, column 4=CourseTitle.

The above criteria doesn't work unless the correct ID is in the matching
bound column.

Cindi
Nov 13 '05 #3

P: n/a
Cindi Simonson wrote:
Thank you. Where exactly do I put that line of code or what do I
associate it with?

Currently, I'm using a separate button and query with
[FORMS]![nameofform]![SELECT] in the criteria to open a report based
on the value selected from a combo box. The combo box contains
column 1=DeptID, column 2 =ProgramID, column 3=CourseID, column
4=CourseTitle.

The above criteria doesn't work unless the correct ID is in the
matching bound column.


You're correct. Then Column(n) syntax does not work from a query. There are
two ways to work around this.

1) I've never used it, but I have read that you can wrap the criteria
expression in the Eval() function and it will work. Instead of...

[FORMS]![nameofform]![SELECT].Column(1)

....try...

Eval([FORMS]![nameofform]![SELECT].Column1))

2) You can create hidden TextBoxes on the form with ControlSource
expressions like...

=[SELECT].Column(1)

=[SELECT].Column(2)

Etc.,

....and then refer to these hidden TextBoxes in your query instead of the
ComboBox.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.