variable coding help

M

m stroup

Dim Divis as string
Dim strWhere as string

Select Case optDivision.value
Case 1
Divis = "Property"
Case 2
Divis = "House"
Case Else
Divis = ""
End Select

StrWhere = " WHERE qryExpense.Status = ""Expensed"" AND qryExpense.Div = " &
Divis

I get a message box asking me to input House, when that is what I would like
the criteria to be.

Any suggestions?
 
P

Paolo

Hi m stroup,
try in this way

StrWhere = " WHERE qryExpense.Status = 'Expensed' AND qryExpense.Div = """ &
Divis & """"

HTH Paolo
 

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