title: UFT VB Script ( If Statement OR and AND )
body: <p>I am QA Engineer and am new to UFT and vb script. I am comparing multiple conditions and UFT keeps erroring out when it reaches code on line 269 starting with the <strong>(if statement)</strong>. It's like it can't read the multiple conditions statement. My code works without the <code>AND</code> condition but I want it to work with the <code>AND</code> condition. My code is below. Any help is appreciated unfortunately organization still use vb scripting for automated tests.</p>
  
  <pre><code>Set PayDate_Calendar = Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayDate_Calendar") 
  Set PayRoll_Calendar = Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayRoll_Calendar") 
  Set Payroll_Out_Calendar = Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("Payroll_Out_Calendar")
  Set PayPeriodStart_Calandar = Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayPeriodStart_Calandar")
  
      '------- PayDate_Calendar--------
  If dayName = dayOne Or dayName = dayTwo Or dayName = dayThree Or dayName = dayFour  AND  PayDate_Calendar = "" Then
      Setting.WebPackage("ReplayType") = 2
      PayDate_Calendar.Click
      'Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayDate_Calendar").Click
      Call EnterDataInField(Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayDate_Calendar")," ")
      Call EnterDataInField(Browser("ADP_2").Page("ADP_10_Calendar").WebEdit("PayDate_Calendar"),(FormatDateTime(dayPlus,2)))
  </code></pre>