Where Condition with multiple value

VSolano

Registered User.
Local time
Yesterday, 19:38
Joined
Feb 21, 2017
Messages
92
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
 
SQLDataSource = " SELECT * FROM tbtaskschedule WHERE TaskAssignedTo = " & TempVars![SYSID] & " And TaskBenefitID = " & forms!frbillingtest!benefitsid
 
This is great information but I could not figure out the problem with my SQL
 

Users who are viewing this thread

Back
Top Bottom