473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Populating a Combo Box with a list of fields

Is there a way to populate a combo box with a list of fields from a table or query? My purpose in doing this is to allow a user to select a field to search.

Also, does anyone have any advice as to the best way to make it so a user can select multiple search criteria? My plan was to just make 5 combo boxes as mentioned above, so people can run searches based on up to 5 criteria. However, I would like to make it so they can use any of the boolean operators in their search. I'm not sure on the best way to go about doing this. Any ideas?

Thanks!
Nov 26 '08 #1
3 1625
FishVal
2,653 Expert 2GB
Hello.

Table and query properties (including fields collection) are accessible via correspondent TableDef and QueryDef objects respectively.
Collections containing TableDef and QueryDef objects are accessible via Database.TableDefs and Database.QueryDefs properties respectively.

As for your 2nd question, you may look at a similar thread.

Regards,
Fish
Nov 26 '08 #2
ADezii
8,834 Expert 8TB
@mattandlisa3
The answer to Part #1 is a simple 3 step process:
  1. Create an Unbound Combo Box
  2. Set its Row Source Type to Field List
  3. Set its Row Source to your Table or Query whose Fields you wish to search
Nov 26 '08 #3
ChipR
1,287 Expert 1GB
If you want your user to be able to pick a number of criteria and then choose AND or OR of all of them, it might not be too difficult to build a criteria string.

strOperator = " AND " or " OR " based on a user choice
then
strSQL = "SELECT * FROM MyTable WHERE " & Criteria1 & strOperator & Criteria2 & strOperator & ect...

But I have a feeling you want to do something more complicated.
Nov 26 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sao | last post by:
I am currently using Access 2000. In my table it is the following fields that are set up: 1 - Staff Name 2 - Department This table is already populated with 100+ records (staff along with...
0
by: KB | last post by:
I am creatig a database in 2000 where I need to be able to have the users add data and information into lookup tables. That is no problem, I have a form for that, that works fine. This...
3
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
2
by: Waran | last post by:
a combo box that starts off empty. The user can type int he combo box, and as he types, after the third letter has been typed, the page does a lookup against a database (SQL String) to our server,...
27
by: wideasleep | last post by:
Hello, I have a form that has a combo box that populates other fields. This works great but it doesn't save that information in the table where those fields are coming from. The only one that's...
6
by: zuchowra | last post by:
Hi everyone. I need help. I have a combo box in my form that i want to populate multiple text boxes after you select your selection in the combo box. Here is my set up. The Fields that need to be...
5
by: a Wellner | last post by:
I am trying to create a from that the user can select a street from a combo box (named street), then pick a second street from another combo box, containing only valid cross streets(named Cross). ...
2
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once...
11
tdw
by: tdw | last post by:
Hi all, I have tried a few different methods to accomplish this, but with no luck. I will post the code for the latest attempt at the end of this post. I work at a land surveying company. This...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.