Using an unbound field from a combo box

  • Thread starter Thread starter Karen C via AccessMonster.com
  • Start date Start date
K

Karen C via AccessMonster.com

I’m working on a form with tab controls listing all reports available to
allow our users to select reports to print or preview. We have a report that
lists all jobs for a selected project manager and one that lists all jobs for
a selected client. Currently this is run from a form with just these two
reports, using a combo boxes with the PM# or client # as the bound field. The
query uses a where clause to limit the records returned by the PM or client #
on the form. As these are long lists, I would like to make the bound field
the PM or client name instead of number as this will be easier for the user.
I’m still learning VB and I’m not sure how to proceed. Currently the code
tests for a default ‘0’ selection to determine which report to run. How can I
tell if a selection was made if the bound field is a name instead of a number?
How do I reference the unbound number from my new form in the query? Should I
change the where clause to use the name instead of the number? Would it be
better to have two option buttons for these two reports? Thank you in advance
for all assistance and suggestions.
 
Use two columns in your combo box, One the the name to display, and one for
the number to user for the report. To minimize changes, leave the number as
the bould column, but make it's width = 0. The user will see only the name,
but the number will still be used in the report. You could use the Combo
Wizard to quide you through it.

Two forms would be one way to go, I would probably opt for that.
 
If I use the number as the bound field, then the user can't type in a partial
name to search for the client or PM. I have the combo box setup with two
fields, just can't figure out how to utilize the number if the name is the
bound field.
Use two columns in your combo box, One the the name to display, and one for
the number to user for the report. To minimize changes, leave the number as
the bould column, but make it's width = 0. The user will see only the name,
but the number will still be used in the report. You could use the Combo
Wizard to quide you through it.

Two forms would be one way to go, I would probably opt for that.
I’m working on a form with tab controls listing all reports available to
allow our users to select reports to print or preview. We have a report that
[quoted text clipped - 11 lines]
better to have two option buttons for these two reports? Thank you in advance
for all assistance and suggestions.
 
Use the Column property. If the number is in the first column:
Me.MyCombo.Column(0) and Me.MyCombo.Column(1) if it is the second column.

Karen C via AccessMonster.com said:
If I use the number as the bound field, then the user can't type in a partial
name to search for the client or PM. I have the combo box setup with two
fields, just can't figure out how to utilize the number if the name is the
bound field.
Use two columns in your combo box, One the the name to display, and one for
the number to user for the report. To minimize changes, leave the number as
the bould column, but make it's width = 0. The user will see only the name,
but the number will still be used in the report. You could use the Combo
Wizard to quide you through it.

Two forms would be one way to go, I would probably opt for that.
I’m working on a form with tab controls listing all reports available to
allow our users to select reports to print or preview. We have a report that
[quoted text clipped - 11 lines]
better to have two option buttons for these two reports? Thank you in advance
for all assistance and suggestions.
 
Thank you so much for your help. That was the little nudge I needed to do
what I wanted. All is working great.
Use the Column property. If the number is in the first column:
Me.MyCombo.Column(0) and Me.MyCombo.Column(1) if it is the second column.
If I use the number as the bound field, then the user can't type in a partial
name to search for the client or PM. I have the combo box setup with two
[quoted text clipped - 14 lines]
 
Back
Top