Where Condition with multiple value (1 Viewer)

VSolano

Registered User.
Local time
Yesterday, 21:06
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

error reading drive A:
Local time
Today, 09:06
Joined
May 7, 2009
Messages
9,881
SQLDataSource = " SELECT * FROM tbtaskschedule WHERE TaskAssignedTo = " & TempVars![SYSID] & " And TaskBenefitID = " & forms!frbillingtest!benefitsid
 

VSolano

Registered User.
Local time
Yesterday, 21:06
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 (Users: 0, Guests: 1)

Top Bottom