I have a text box that uses this code to append numbers together for a criteria for a query.
Then in my qurey criteria i have Forms!Test!Type2
This has the correct output if only one number is in the field ex 10 but once the text box changes from that to "10 or 30" it stops working. Although if i past "10 or 30" into the criteria box it works correctly. Any ideas on how to make this work correctly?
Thanks,
Glenn
Code:
Dim AddText As String
Dim NewText As String
Dim strOr As String
If Forms!Test!Type2.Value = "" Then
strOr = ""
Oldtext = Forms!Test!Type2.Value
AddText = Me.QuestionID
NewText = Oldtext & strOr & AddText
Forms!Test!Type2.Value = NewText
Else
strOr = " or "
Oldtext = Forms!Test!Type2.Value
AddText = Me.QuestionID
NewText = Oldtext & strOr & AddText
Forms!Test!Type2.Value = NewText
End If
Then in my qurey criteria i have Forms!Test!Type2
This has the correct output if only one number is in the field ex 10 but once the text box changes from that to "10 or 30" it stops working. Although if i past "10 or 30" into the criteria box it works correctly. Any ideas on how to make this work correctly?
Thanks,
Glenn