Dropdown box in a form

N

Normek

Years ago, I created a simple database in Access 97, to track prices of
grocery items. Since the list was generally the same I used the column of
groceries as the basis of the dropdown list, which could be easily extended,
in an entry form.

I have since deleted this database so I can't check it out, but I do know
that it was created without me writing any code whatsoever. I can't see how
I can do this in Access 2007, can anyone point me in the right direction?
 
T

Tom Wickerath

Hi Normek,
I have since deleted this database so I can't check it out, but I do know
that it was created without me writing any code whatsoever.

You may be right. However, if you used a wizard in Access 97 (or Access
2000/2002/2003), the wizard likely created the VBA code for you, without you
possibly even knowing about it. This article is based in large part on the
same type of code:

Combo box to find a record
http://www.access.qbuilt.com/html/find_a_record.html


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
N

Normek

Hi Tom,
Basically I used the wizards to write the code. It worked fine, but I later
tweeked it a bit in the properties box. eg
Row source: SELECT DISTINCT [Coles].[Units], [Coles].[Units] FROM Coles
ORDER BY [Units];
to eliminate the duplicates and order the Combo Box Dropdown.
I would have called this a formula, but maybe you could call it "code" or a
"filter"
Anyway it works,
 
T

Tom Wickerath

Hi Normek,
I would have called this a formula, but maybe you could call it "code" or a
"filter"

If your row source is set programmatically, then it would be VBA code.
However, if it is simply a hard-coded row source, then I would call it a SQL
(Structured Query Language) statement (aka "Query", although it is not a
saved query).

Glad to hear that you got it working.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Normek said:
Hi Tom,
Basically I used the wizards to write the code. It worked fine, but I later
tweeked it a bit in the properties box. eg
Row source: SELECT DISTINCT [Coles].[Units], [Coles].[Units] FROM Coles
ORDER BY [Units];
to eliminate the duplicates and order the Combo Box Dropdown.
I would have called this a formula, but maybe you could call it "code" or a
"filter"
Anyway it works.
 

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