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
 
Top