else without if error

bconner

Registered User.
Local time
Yesterday, 21:41
Joined
Dec 22, 2008
Messages
183
trying to update the last field below using if statement but i keep getting the else without if error...... My syntax looks right.... I searched this forum and all of the examples that worked seem to match what I have...

Any ideas what I am doing wrong!


Code:
rs.AddNew
'Enter Greeting Stats
rs![Date Of QC] = txt_CustomerService_MonitorDate
rs![Auditor] = cmb_CustomerService_Auditor
rs![User] = cmb_CustomerService_User
rs![Group] = cmb_CustomerService_Group
rs![Category] = "Greeting"
rs![Description] = "Used Proper Greeting"
rs![Result] = cmb_Greeting1
rs![Record ID] = txt_Unique_Record_ID
If cmb_Greeting1 = "YES" Then rs![Points] = 5
 Else
  rs![Points] = 0
End If
rs.Update
 
Are you using the bound column in the "IF" statement containing cmb_Greeting1?
 
Yes cmb_Greeting1 is a combo box that lists "YES", "NO", "N/A". If cmb_Greeting1 = "YES" I want to put the value 5 in the rs![Points] field else 0
 
May be silly, but I think your syntax is wrong. Try this:
Code:
If cmb_Greeting1 = "YES" Then 
rs![Points] = 5
 Else
  rs![Points] = 0
End If
 
That Worked! thank you all for your help, I appreciate it.
 

Users who are viewing this thread

Back
Top Bottom