Combo box without using a linked table

GregP

Registered User.
Local time
Tomorrow, 08:37
Joined
Sep 16, 2002
Messages
66
This is probably a very simple one, but I haven't had much success thus far.

I know you can make a table field a drop-down combo box by selecting 'combo box' in the setup, and then telling it to get the data for the combo box from another table, but is there some way to do it without another table? E.g. if I wanted to have a drop-down box with the choice of 'Male' or 'Female', how would I do it without creating a second table with one field and just the records 'Male' and 'Female'? Surely there's a short SQL or similar statement I can put in the 'Control Source' field to generate the same result? SELECT 'Male' OR 'Female' FROM ...........what?
 
You don't need the combo in the table, just add it to the form, select value list when the wizard prompts
 
Surely there must be some way of doing it though... the SQL tells it to get such and such info from another source, can't you redefine the source of the info? E.g. something like just SELECT 'Male' OR 'Female'
 
Not precisely sure of the question so here are three answers:

1. You can use a Value List -- rather than a table -- as the data source for a combo box. This can be done using the combo box wizard, as Rich said. See RowSourceType and RowSource in Help for more information.

2. You can also use a SELECT query as the source for a combo box. See the Help reference above. Can also be done with combo wizard -- see Rich's reply.

3. You can change the combo's row source property on the fly. I'm sure there was a post here a month or so ago with an attached demo. Search on user name Ghudson and keyword combo.

Regards,
Tim
 
Thanks for that, got it to work. Not sure if it's exactly what you were saying, but I did the following (may help anyone else with the same question):

* Click on 'Lookup' tab
* Change 'Display Control' from 'Text Box' to 'Combo Box'
* Change Row Source Type from 'Table/Query' to 'Value List'
* Enter the desired text into 'Row Source' separated by semi-colons, in this case Male;Female

Thanks again!
 
Greg,

Thanks for your thanks -- not that it matters or anything [a wave to the posters in the "Annoying" thread in the Watercooler, AutoEng gleaming with perspiration].

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom