combobox

  • Thread starter enrico via AccessMonster.com
  • Start date
E

enrico via AccessMonster.com

my combobox is queried base on the year you input on a particular textbox.
the problem is nothing appears on my combobox. this is the query on the
control source of my combobox, i don't know if it's correct:

SELECT tblClient.Group
FROM tblClient
WHERE (((tblClient.Year)='" & me.txtYear & "'))

please tell what's wrong with my query or on the whole process of getting my
data
 
S

Stuart McCall

enrico via AccessMonster.com said:
my combobox is queried base on the year you input on a particular textbox.
the problem is nothing appears on my combobox. this is the query on the
control source of my combobox, i don't know if it's correct:

SELECT tblClient.Group
FROM tblClient
WHERE (((tblClient.Year)='" & me.txtYear & "'))

please tell what's wrong with my query or on the whole process of getting
my
data

In Access, date values must be surrounded by hash marks (#), so replace your
apostrophes with hash marks:

WHERE (((tblClient.Year)="#" & me.txtYear & "#"))
 
G

Gina Whipp

Enrico,

The first problem is your field names... 'Group' and 'Year' are reserved
words in Access, so right away that is an issue. You need to rename those
fields.

You said the below is on a combo box, try the below...

SELECT tblClient.Group
FROM tblClient
WHERE (((tblClient.Year)=[Forms]![YourFormName]![txtYear]));


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

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