Can a combo box contain column headings? (Access 2007)

G

Guest

I have a table called radial miles with 600 town names in the field and 35
quarries as column headings. All the radial mileages are filled out in the
coresponding text boxes. I have a quotation form with several combo boxes
that works well, but i am struggling with the last two.
The first is called town and the second called quarry, I need the final text
box on my form to fill in with the radial miles based on my choices in these
two combo boxes. I know this must be possible but am not sure how to do it.
 
G

Guest

Hi Brunty

Open the form in design view
Right click the combo
Select properties box
In the "All" column select Column Heads = Yes

Hope this helps


--
Wayne
Manchester, England.
Enjoy whatever it is you do
Scusate,ma il mio Inglese fa schiffo :)
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.
 
J

John Vinson

I have a table called radial miles with 600 town names in the field and 35
quarries as column headings. All the radial mileages are filled out in the
coresponding text boxes. I have a quotation form with several combo boxes
that works well, but i am struggling with the last two.
The first is called town and the second called quarry, I need the final text
box on my form to fill in with the radial miles based on my choices in these
two combo boxes. I know this must be possible but am not sure how to do it.

You don't have a table. You have a spreadsheet.

Storing data - such as the name of a quarry (which I initially misread
as a typo for "query", much to my confusion!!) in a fieldname is
simply *incorrect design*.

Your radial miles table should instead be tall and thin, with three
fields: TownName, QuarryName, Distance.

You can create a "conditional combo" pair on a Form so that you can
pick out a town in combo box cboTownName, and have a second combo box
listing all of the distances from that town; base the second combo
(cboQuarry) on a "quarry query" such as

SELECT Quarry, Distance
FROM Quarries
WHERE Quarries.TownName = [Forms]![YourFormName]![cboTownName]
ORDER BY Quarry;

and put a textbox on the form with control source

=cboQuarry.Column(1)

to display the second column (it's zero based) of the quarries combo
box.

John W. Vinson[MVP]
 
G

Guest

Thank you for the reply,
I had the table set out as you had suggested as well.
The problem i have is that the combo box with quarry in is set by the choice
of product you make. That is why i had the radial miles set up the way i had.

On my form you select cboProduct which then gives you the options in
cboQuarry, when you select a quarry it autofills the cost price in another
textbox. You then select cboTown and i need the textbox distance to autofill
from the radial miles using the choice you make in the cboTown and the
unrelated cboQuarry.

I really need to know how to phrase the quarry query so that it looks in the
cboTown then the cboQuarry and returns a value from the radmiles table (my 3
column table) in the textbox distance.

I hope this makes more sense this time.
Mark


John Vinson said:
I have a table called radial miles with 600 town names in the field and 35
quarries as column headings. All the radial mileages are filled out in the
coresponding text boxes. I have a quotation form with several combo boxes
that works well, but i am struggling with the last two.
The first is called town and the second called quarry, I need the final text
box on my form to fill in with the radial miles based on my choices in these
two combo boxes. I know this must be possible but am not sure how to do it.

You don't have a table. You have a spreadsheet.

Storing data - such as the name of a quarry (which I initially misread
as a typo for "query", much to my confusion!!) in a fieldname is
simply *incorrect design*.

Your radial miles table should instead be tall and thin, with three
fields: TownName, QuarryName, Distance.

You can create a "conditional combo" pair on a Form so that you can
pick out a town in combo box cboTownName, and have a second combo box
listing all of the distances from that town; base the second combo
(cboQuarry) on a "quarry query" such as

SELECT Quarry, Distance
FROM Quarries
WHERE Quarries.TownName = [Forms]![YourFormName]![cboTownName]
ORDER BY Quarry;

and put a textbox on the form with control source

=cboQuarry.Column(1)

to display the second column (it's zero based) of the quarries combo
box.

John W. Vinson[MVP]
 

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