combo box calculations

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

Guest

Hi,

I was wondering is it possible to use a selection in a combo box within a
calculation in a query?

What i am creating is a form to store information regarding degree module
information, so what I would like to do is to be able to select a year a
module is running in and then in my subform enter information about a
particular degree.

The bit where i need the calculation is if I have a degree which is running
in say 2005 and 2006 when I select 2006 as the year the module is running in
I want a combo which will allow my user to select either Stage 2 (for the
2005 degree) or Stage 1 (for the 2006 degree), but if the module is running
in 2005 it should show Stage 1 for the 2005 degree. hope that makes some sort
of sense
 
Hi,


Not sure at all I follow the requirements, but if you need to "get" the
value of a combo box, or of any other control supplying just one value, you
can use the syntax FORMS!FormNameHere!ControlNameHere with DoCmd, or
within a RowSource/RecordSource. You cannot if you use CurrentDb to run the
query, in that case, you can either write the statement as a string:

strSQL="SELECT.... WHERE ... fieldName='" & Me.CoboBoxName & "' "

note that you need to add the required delimiters in that case.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top