Combo Box Using Multiple Columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have a form with a two column combo box which is populated from the result
of a query on my database.

When the user selects an item, the value is used as a condition(s) in a
report so:

[Forms]![SelectUser]![txtCName].

I can select either of the columns using the Bound Column property but would
like to use the values from both columns in my condition, to allow me to
select a particular record for the report.

Can anyone point me in the right direction please?

Thanks in advance

Malc
 
Try:

Forms!MyForm!cboMyCombo.Column(0)

Columns are zero-based, so the first column is 0.

HTH,
Barry
 
Barry

Thanks for the reply.

I should point out that working with access reporting and forms is not the
main part of my job, which involves using authoring software with ODBC
connections to a database. Consequentky, I am not as conversant with Access
programming as I would like to be as the reporting system is a “value addedâ€
extra.

Looking at the information you supplied, it looks like visual basic, which I
have only touched on. Is there any way of entering the criteria direct into
the query in design view like this:

[Forms]![SelectUser]![txtCName].[Column(0)] -- or similar

I understand that sometimes some commands cannot be entered this way and
have to be coded in a visual basic piece. If this is the case could you
point me to the best way to do so.

Many thanks in advance.

Malc


Barry Gilbert said:
Try:

Forms!MyForm!cboMyCombo.Column(0)

Columns are zero-based, so the first column is 0.

HTH,
Barry

Hamlet said:
Hi all

I have a form with a two column combo box which is populated from the result
of a query on my database.

When the user selects an item, the value is used as a condition(s) in a
report so:

[Forms]![SelectUser]![txtCName].

I can select either of the columns using the Bound Column property but would
like to use the values from both columns in my condition, to allow me to
select a particular record for the report.

Can anyone point me in the right direction please?

Thanks in advance

Malc
 
This isn't VB; just a way to refer to a property of a control. It can be
stored in the query, but with a slight change:

[Forms]![SelectUser]![txtCName].Column(0)

No square brackets around the last piece.

Barry

Hamlet said:
Barry

Thanks for the reply.

I should point out that working with access reporting and forms is not the
main part of my job, which involves using authoring software with ODBC
connections to a database. Consequentky, I am not as conversant with Access
programming as I would like to be as the reporting system is a “value addedâ€
extra.

Looking at the information you supplied, it looks like visual basic, which I
have only touched on. Is there any way of entering the criteria direct into
the query in design view like this:

[Forms]![SelectUser]![txtCName].[Column(0)] -- or similar

I understand that sometimes some commands cannot be entered this way and
have to be coded in a visual basic piece. If this is the case could you
point me to the best way to do so.

Many thanks in advance.

Malc


Barry Gilbert said:
Try:

Forms!MyForm!cboMyCombo.Column(0)

Columns are zero-based, so the first column is 0.

HTH,
Barry

Hamlet said:
Hi all

I have a form with a two column combo box which is populated from the result
of a query on my database.

When the user selects an item, the value is used as a condition(s) in a
report so:

[Forms]![SelectUser]![txtCName].

I can select either of the columns using the Bound Column property but would
like to use the values from both columns in my condition, to allow me to
select a particular record for the report.

Can anyone point me in the right direction please?

Thanks in advance

Malc
 
Back
Top