Querys using combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a project listing database where the projects status are marked in a
column called "Status" using a combo box (In progress, completed, cancelled
etc)

I am trying to find an easy way to create some sort of form/table/query
where it is easy to view all of the In progress projects at a click of a
button but am having trouble as I cannot get the query to recognise "In
Progress" as it is part of a combo box and not keyed-in text.

Please help as I am tearing my hair out here!

Thanks
Katie
 
Hello Katie.

kateyliz said:
I have a project listing database where the projects status are marked
in a column called "Status" using a combo box
(In progress, completed, cancelled etc)

I am trying to find an easy way to create some sort of form/table/query
where it is easy to view all of the In progress projects at a click of
a button but am having trouble as I cannot get the query to recognise
"In Progress" as it is part of a combo box and not keyed-in text.

Check the table that contains the status definitions. And also check the
bound column of the combo box. I guess, it stores a number?
If the text is needed in your query and the text is in column 2 (not the
bound column), you can create a function in a module:

Function GetStatus() As String
GetStatus = Forms!NameOfYourForm!NameOfCombo.column(1)
End Function

Then use this function in your query.
Please help as I am tearing my hair out here!

Don't.
 
Hello Katie.



Check the table that contains the status definitions. And also check the
bound column of the combo box. I guess, it stores a number?
If the text is needed in your query and the text is in column 2 (not the
bound column), you can create a function in a module:

Function GetStatus() As String
GetStatus = Forms!NameOfYourForm!NameOfCombo.column(1)
End Function

Then use this function in your query.


Don't.

Don't forget the word "in" is a special reserved keyword in access. it
might be interpreting it as IN "Progress" and is failing. I'm not sure what
the best way to get around it, but I would check to see if this is it.
just my $.02
Steve
 
Hello Steve.

Don't forget the word "in" is a special reserved keyword in access.
it might be interpreting it as IN "Progress" and is failing. I'm not
sure what the best way to get around it, but I would check to see
if this is it.

Right, that also can have been the problem. To get around it, Katie
should set the quotes herself: "in progress".
 
Hi Wolfgang and Steve

Thanks for your replies - they have been most helpful.

I have tried the "In_progress" approach which didn't work, but when I tried
it with "Cancelled" it did, so I can see my issue is that Access is getting
confused as "In" is a keyword for it.

I think for easiness sake I will change "In Progress" to "Current Projects"
as it is proving too complicated to find a way to work around the "In" issue.

Thanks :o)

Katie
 

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

Back
Top