J
James Houston
I'm trying to run the following query:
SELECT ITEMS.[ORDER#], ITEMS.[ITEM#], ITEMS.COLOR, ITEMS.SIZE,
ParseSize([items]![size]) AS ParsedSize
FROM ITEMS
WHERE (((ParseSize([items]![size]))=[Enter Size]));
where ParseSize is a function I wrote which strips the " X " from a string
like "38 X 32" and returns "3832". The query runs fine if I don't try to
prompt for user input, but throws an error otherwise. The code for the
function is below:
Function ParseSize(ByVal sSizeToParse As String) As String
Dim sWL, sW, sL As String
sSizeToParse = Trim(sSizeToParse)
sWL = " X "
If InStr(sSizeToParse, sWL) Then
sW = Left$(sSizeToParse, 2)
sL = Right$(sSizeToParse, 2)
ParseSize = sW & sL
End If
End Function
Thanks in advance
Jim
SELECT ITEMS.[ORDER#], ITEMS.[ITEM#], ITEMS.COLOR, ITEMS.SIZE,
ParseSize([items]![size]) AS ParsedSize
FROM ITEMS
WHERE (((ParseSize([items]![size]))=[Enter Size]));
where ParseSize is a function I wrote which strips the " X " from a string
like "38 X 32" and returns "3832". The query runs fine if I don't try to
prompt for user input, but throws an error otherwise. The code for the
function is below:
Function ParseSize(ByVal sSizeToParse As String) As String
Dim sWL, sW, sL As String
sSizeToParse = Trim(sSizeToParse)
sWL = " X "
If InStr(sSizeToParse, sWL) Then
sW = Left$(sSizeToParse, 2)
sL = Right$(sSizeToParse, 2)
ParseSize = sW & sL
End If
End Function
Thanks in advance
Jim