473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Combo box bound column value

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
3 16629
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
2
by: Ed via AccessMonster.com | last post by:
Hi all, What I am trying to do is get the value of the second column of a bound combo box in vba. example: Combo box: column 1-ID column 2-SIGN_CODE 1 R-1.gif 2 ...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
by: RamanS | last post by:
I have created a combo box with the following properties: RowSourceType: Value List RowSource: "0%";"10%";"25%";"36%";"37%" Bound to column: 1 Limit to List = Yes Default Value = None Format:...
4
by: Karl | last post by:
Using A2000 with 2 tables Table 1 is a reference table with 2 fields Table 2 has 2 fields and 2 combo boxes to lookup date in table 1 Combo1 binds to col 1 in table 1, this works OK Combo 2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.