View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
westg westg is offline
external usenet poster
 
Posts: 16
Default inserting variables in code????

I have a problem trying to insert user input values in a where statement, the
user provides the data via a userform. numonth and nuyear are populated, i
them want to add these to the where statement as below -

Dim numonth As String 'numonth = 05
Dim nuyear As String 'nuyear = 5
"WHERE (VinstCoreData.ResDate= 50501 And VinstCoreData.ResDate<= 50531) AND
(VinstCoreData.PRG Like '%MOTIS%')" _

How can I insert the numonth and nuyear into the where statement??? Any ideas?

Thanks, Andrew.