Combo Box

G

Guest

My last post may no have been that clear, so I will atempt to simplify.
Thanks to those who responded, you information will be used in other ways and
was very helpful.

I have a customer form. I want to be able to put a combo box that contains a
hidden CustId and cisible CustomnerName on it so that I can select a customer
from the combo box and the pointer will jump (or refresh) to that customer.
The functionality I want is exactly the same as selecting a record number in
the record navigator bar. That is, I don't particularly want to filter the
recordset, just go to the approriate record in the recordset. That is "where
CustId = 20" for example based on the users selection in the combo box.

My last post had a reply that stated there was a wizard that asked this
question when you put a combo box on your form, and MS help states this as
well for when you put list boxes or combo boxes on a form, however I don't
seem to be getting this. This was not the case, the wizard did not ask about
opening a specific record based on my choice.

MS Access Help topic states
"
Find a record by selecting a value from a list
On a form, you can create a list box or a combo box that finds a record when
you select a value from the list.

Open the form in Design view.
Click Control Wizards in the toolbox if it's not already pressed in.
In the toolbox, click List Box or click Combo Box .
On the form, click where you want to place the list box or combo box.
In the first wizard dialog box, click the option to find a record based on
the value you selected in the list box or combo box. (THIS STEP DOES NOT
OCCUR ON MY WIZARD!!!)
Follow the directions in the wizard dialog boxes. In the last dialog box,
click Finish to display the list box or combo box in Design view.
If you want to see the event procedure that makes the list box or combo box
work, open the box's property sheet, and then click the Build button next to
the AfterUpdate property box.

As the wizard doesn't seem to be doing as it's told ;-) VBA code to find
the record based on my selection would be great and a recommendation for the
event to attach to. :)

Again your patience and assistance is greatly appreciated.
 
M

Mike Painter

Dylan said:
My last post may no have been that clear, so I will atempt to
simplify. Thanks to those who responded, you information will be used
in other ways and was very helpful.

I have a customer form. I want to be able to put a combo box that
contains a hidden CustId and cisible CustomnerName on it so that I
can select a customer from the combo box and the pointer will jump
(or refresh) to that customer.
Open the form in Design view.
Click Control Wizards in the toolbox if it's not already pressed in.
In the toolbox, click List Box or click Combo Box .
On the form, click where you want to place the list box or combo box.
In the first wizard dialog box, click the option to find a record
based on the value you selected in the list box or combo box. (THIS
STEP DOES NOT OCCUR ON MY WIZARD!!!)

If your form is based on the table or a query where this table is the "one"
side then you can use this method.

If it's not available then it's usually not needed.
You would use a query based on the customer table in your form and the key
value would be entered as a foreign key in a query where you had the ID from
say a Purchase table (Purchase!CustID) related to the customer file and
showed the name from the customer table/.
 
G

Guest

I have just one table. tblCustomer.

There are subforms on my form but this is irrelevant to my need.

The parent form based on a record source form the tblCustomer.

I want to put a combo box on the parent form that will navigate to the
customer selected (when selected). I don't want a filter. Just to navigate to
the appropiate cistomer selected in my combo box.

Any help is great.
 
G

Guest

I have just one table. tblCustomer.

There are subforms on my form but this is irrelevant to my need.

The parent form is based on a record source form the tblCustomer.

I want to put a combo box on the parent form that will navigate to the
customer selected (when selected) from the combo box. I don't particularly
want a filter but would live with one. Just to navigate to the appropiate
customer selected in my combo box is my primary need.

Any help is great.
 
G

Graham R Seach

Dylan,

There is a control wizard on the form Toolbox for just that purpose. Add a
combo to the form while the control wizard is active.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
R

Rick Brandt

Dylan said:
My last post may no have been that clear, so I will atempt to
simplify. Thanks to those who responded, you information will be used
in other ways and was very helpful.

I have a customer form. I want to be able to put a combo box that
contains a hidden CustId and cisible CustomnerName on it so that I
can select a customer from the combo box and the pointer will jump
(or refresh) to that customer. The functionality I want is exactly
the same as selecting a record number in the record navigator bar.
That is, I don't particularly want to filter the recordset, just go
to the approriate record in the recordset. That is "where CustId =
20" for example based on the users selection in the combo box.

My last post had a reply that stated there was a wizard that asked
this question when you put a combo box on your form, and MS help
states this as well for when you put list boxes or combo boxes on a
form, however I don't seem to be getting this. This was not the
case, the wizard did not ask about opening a specific record based on
my choice.

MS Access Help topic states
"
Find a record by selecting a value from a list
On a form, you can create a list box or a combo box that finds a
record when you select a value from the list.

Open the form in Design view.
Click Control Wizards in the toolbox if it's not already pressed in.
In the toolbox, click List Box or click Combo Box .
On the form, click where you want to place the list box or combo box.
In the first wizard dialog box, click the option to find a record
based on the value you selected in the list box or combo box. (THIS
STEP DOES NOT OCCUR ON MY WIZARD!!!)

For this option to appear your form must be bound directly to a table or to a
saved query. If the RecordSource of the form is a SQL statement then the option
is not displayed. Just change the RecordSource to a Table or saved Query and
then the option should appear in the wizard.

By the way, if your customer table is large applying a filter is much more
efficient than doing the "navigate by code" that this method uses. Especially
if the app is being used over a network.
 
G

Guest

After assistance from so many helpful people, my solution is found.
Thanks to everyone who assisted.
RBrandt - your help was the solution. My form was based on an SQL statement
and not a table or saved query, therefore the third option in the wizrad did
not appear. Changed the recordsoruce to a saved query and all is good. Thanks
for the help. Much better customer form as a result.
I now have the combo box and a search button, rather than just the search.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top