Combo Box - Help Please!

G

Guest

Hi
I have a little knowledge of MS Access!
I want to create a from which will display a Combo Box and Three Text Boxes.
The Combo Box Populates itself from the table Salesman_Details and displays
the field Salesman_Name Column hiding the primary key Column Salesman_Id.
I want to be able to select an item from the Combo Box which then populates
the Three Text boxes with the relevent details relating to the selected item
from the list! This works fine but my problem lies when i load the form as
the text boxes populate themselves with the first reocrd BEFORE i have
selected a value from the Combo Box!

The Form's Source is Salesman_Details (table) and i have used the Combo Box
Wizard which automatically creates the macro to update the text boxes!
Each Text box row source points to the relevant column within
Salesman_Details!
I want the form to load WITHOUT any of the text boxes being populated until
AFTER i have selected it from the Combo Box!

Please let me know if you require any other details - im sure its something
really simple, but my Access skills are a little rusty!

Thanks in Advance!

DRodway
 
R

Rick Brandt

Drodway said:
Hi
I have a little knowledge of MS Access!
I want to create a from which will display a Combo Box and Three Text
Boxes. The Combo Box Populates itself from the table Salesman_Details
and displays the field Salesman_Name Column hiding the primary key
Column Salesman_Id.
I want to be able to select an item from the Combo Box which then
populates the Three Text boxes with the relevent details relating to
the selected item from the list! This works fine but my problem lies
when i load the form as the text boxes populate themselves with the
first reocrd BEFORE i have selected a value from the Combo Box!

The Form's Source is Salesman_Details (table) and i have used the
Combo Box Wizard which automatically creates the macro to update the
text boxes!
Each Text box row source points to the relevant column within
Salesman_Details!
I want the form to load WITHOUT any of the text boxes being populated
until AFTER i have selected it from the Combo Box!

Please let me know if you require any other details - im sure its
something really simple, but my Access skills are a little rusty!

Thanks in Advance!

DRodway

First you need to understand what your form and ComboBox are actually doing. If
you did in fact use the wizard to create the ComboBox then it is NOT populating
the other three TextBoxes when you make a selection. What it is doing is
navigating your form to the existing record matching the selection made. It is
moving to that record that causes the TextBoxes to display the values in the
fields found on that particular record.

That might sound like nit-picking, but it is a very important distinction
because one could use a whole variety of methods to cause those TextBoxes to
display the three pieces of data related to the ComboBox selection and which
method used does make a difference on other behaviours of the form.

So, since your ComboBox is really nothing more than a navigation device on a
bound form that is why you see data in the TextBoxes upon opening the form. It
is because by default a bound form opens at "Record 1 of n" and that first
record's data is what you see in the three TextBoxes.

One way to have the form start off blank would be to open it with a filter
applied that shows zero records. Another would be to open it in DataEntry mode
(same thing really). The problem with those approaches is that you would have
to add code to your ComboBox event that removes the filter first otherwise the
code will not be able to navigate to the matching record (it does not exist in
the form's record set when such a filter is applied).

Another approach would be to add code to your form's Open event that navigates
it to the New Record position...

DoCmd.RunCommand acCmdRecordsGoToNew

With that method all of your records are available, but you start off at the end
of the Record Set (in the new record position) so that the TextBoxes are blank.
This is not a great way to do things if you are working with a large table over
a network due to the amount of data pulled, but you could try it and see how it
performs for you.

I personally prefer to have such a ComboBox *Filter* on the choice made rather
than *Navigate* to the choice made. It is more efficient and pulls less data
over the network. In addition I can start off the form with a filter that
returns zero records and the ComboBox still works because I am replacing the
blank filter with a different one.
 
G

Guest

The first question I would ask is if you have a default value in the combo
box?

The text boxes are usually based on the columns in the combo

= [combobox name].column(n)

where "n" starts from column zero.

Are the textboxes bound or unbound?
 
G

Guest

Thanks For That!

One further Question - Can you bind the text boxes to the column name rather
than the column numbers?

scubadiver said:
The first question I would ask is if you have a default value in the combo
box?

The text boxes are usually based on the columns in the combo

= [combobox name].column(n)

where "n" starts from column zero.

Are the textboxes bound or unbound?

--

http://www.ready4mainstream.ny911truth.org/index.html


Drodway said:
Hi
I have a little knowledge of MS Access!
I want to create a from which will display a Combo Box and Three Text Boxes.
The Combo Box Populates itself from the table Salesman_Details and displays
the field Salesman_Name Column hiding the primary key Column Salesman_Id.
I want to be able to select an item from the Combo Box which then populates
the Three Text boxes with the relevent details relating to the selected item
from the list! This works fine but my problem lies when i load the form as
the text boxes populate themselves with the first reocrd BEFORE i have
selected a value from the Combo Box!

The Form's Source is Salesman_Details (table) and i have used the Combo Box
Wizard which automatically creates the macro to update the text boxes!
Each Text box row source points to the relevant column within
Salesman_Details!
I want the form to load WITHOUT any of the text boxes being populated until
AFTER i have selected it from the Combo Box!

Please let me know if you require any other details - im sure its something
really simple, but my Access skills are a little rusty!

Thanks in Advance!

DRodway
 
G

Guest

Hi

Any clues how i can then edit the populated within the text boxes and update
or delete the record. It will not allow me to edit or delte the record as
the shown details are bound to the results from the combo box?

scubadiver said:
The first question I would ask is if you have a default value in the combo
box?

The text boxes are usually based on the columns in the combo

= [combobox name].column(n)

where "n" starts from column zero.

Are the textboxes bound or unbound?

--

http://www.ready4mainstream.ny911truth.org/index.html


Drodway said:
Hi
I have a little knowledge of MS Access!
I want to create a from which will display a Combo Box and Three Text Boxes.
The Combo Box Populates itself from the table Salesman_Details and displays
the field Salesman_Name Column hiding the primary key Column Salesman_Id.
I want to be able to select an item from the Combo Box which then populates
the Three Text boxes with the relevent details relating to the selected item
from the list! This works fine but my problem lies when i load the form as
the text boxes populate themselves with the first reocrd BEFORE i have
selected a value from the Combo Box!

The Form's Source is Salesman_Details (table) and i have used the Combo Box
Wizard which automatically creates the macro to update the text boxes!
Each Text box row source points to the relevant column within
Salesman_Details!
I want the form to load WITHOUT any of the text boxes being populated until
AFTER i have selected it from the Combo Box!

Please let me know if you require any other details - im sure its something
really simple, but my Access skills are a little rusty!

Thanks in Advance!

DRodway
 
R

Rick Brandt

Drodway said:
Hi

Any clues how i can then edit the populated within the text boxes and
update or delete the record. It will not allow me to edit or delte
the record as the shown details are bound to the results from the
combo box?

Did you see my previous response? That expalins what you need to do.
 

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