passing range values into query criteria problems...

  • Thread starter Thread starter james
  • Start date Start date
J

james

okay, so why won't this work?

i put the message box in to tell me what the code was writing, and it
is EXACTLY the same as if i hard coded it into the query criteria.
so , query criteria typed straight into query works but doesn't if
returned by the following function... by the way Chr(34) is ".
thanks in advance!

Public Function changeBatch() As Variant

Dim changeCriteria As String
Dim lowCriteria As Integer
Dim highCriteria As Integer

lowCriteria = InputBox("Enter the lower batch number:", "Accuracy
Report Creator")
highCriteria = InputBox("Enter the higher batch number:", "Accuracy
Report Creator")

changeCriteria = ">=" & Chr(34) & lowCriteria & Chr(34) & " And <=" &
Chr(34) & highCriteria & Chr(34)

changeBatch = changeCriteria

MsgBox (changeBatch)

End Function



PS. Sorry about posting in forums... too much coffee, too little sleep.
 
okay, so why won't this work?

Answered in microsoft.public.access. Please do not multipost; if you
must, you can crosspost by putting all the newsgroups (2 or 3 at the
most) in the Newsgroups line. Multiposting wastes the volunteers' time
answering questions which have already been answered elsewhere.

John W. Vinson[MVP]
 
Back
Top