Where Condition with multiple value (1 Viewer)

VSolano

Registered User.
Local time
Today, 16:35
Joined
Feb 21, 2017
Messages
85
I will gladly apricate any help from this forum regarding this code.
I am passing various value from one from to another. The first part of the SQL works fine by when I adding another value it does not work. I tried the value with a variable and still I get the mismatch.

Code:
Private Sub Form_Open(Cancel As Integer)
Call taskschedule
Me.AllowEdits = False
Dim SQLDataSource As String
Dim STWhere As String
Dim Benf As Integer
 
Benf = Forms!frbillingtest!benefitsid
 
    SQLDataSource = " SELECT * FROM tbtaskschedule WHERE TaskAssignedTo = " & TempVars![SYSID] And TaskBenefitID = "  & forms!frbillingtest!benefitsid  "
    
    
    
    Me.RecordSource = SQLDataSource
    Me.Requery
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:35
Joined
May 7, 2009
Messages
19,169
SQLDataSource = " SELECT * FROM tbtaskschedule WHERE TaskAssignedTo = " & TempVars![SYSID] & " And TaskBenefitID = " & forms!frbillingtest!benefitsid
 

VSolano

Registered User.
Local time
Today, 16:35
Joined
Feb 21, 2017
Messages
85
This is great information but I could not figure out the problem with my SQL
 

Users who are viewing this thread

Top Bottom