G
gaba
Hi, I'm working on an Access Project (front end) with MSDE (back end). I've
created a search form to open reports. I need to create a Where clause to let
the user enter two values: between ---- And ----
I'm getting an "incorrect syntax near the keyword 'between'.
part of the code goes:
Dim varWhere As Variant
'Initialize to Null
varWhrere = Null
If (Me![SSForms] = 1) Then
DocName = "WWDW_Sample_Submission"
If Not IsNothing(Me.StartID) Then
'.. build the predicate
varWhere = "[LabID]=" & "Between " & Me.[StartID] & "AND " & Me.[ToID]
End If
If (Button = "print") Then
DoCmd.OpenReport DocName, A_NORMAL
Else
DoCmd.OpenReport DocName, A_PREVIEW, WhereCondition:=varWhere
End If
Any help will be greatly appreciated,
created a search form to open reports. I need to create a Where clause to let
the user enter two values: between ---- And ----
I'm getting an "incorrect syntax near the keyword 'between'.
part of the code goes:
Dim varWhere As Variant
'Initialize to Null
varWhrere = Null
If (Me![SSForms] = 1) Then
DocName = "WWDW_Sample_Submission"
If Not IsNothing(Me.StartID) Then
'.. build the predicate
varWhere = "[LabID]=" & "Between " & Me.[StartID] & "AND " & Me.[ToID]
End If
If (Button = "print") Then
DoCmd.OpenReport DocName, A_NORMAL
Else
DoCmd.OpenReport DocName, A_PREVIEW, WhereCondition:=varWhere
End If
Any help will be greatly appreciated,