T
thad
Hi all,
I am trying to build an if statement that is built by
checking equality. Can you tell me why the following code
below has a data type error when I run it. What can I do
to fix the loop.
rsProdFam.MoveFirst
Count = 0
'Build if statement
Do While Not rsProdFam.EOF
If rsProdFam!Description = "Sep Sleeve" And Count
= 0 Then
SepSleeveIfStatement = Left(rsMasterSepSleeve!
Prod_No, 6) & " <> " & rsProdFam!AddH_Prod_Fam
Count = Count + 1
ElseIf rsProdFam!Description = "Sep Sleeve" And
Count > 0 Then
SepSleeveIfStatement = SepSleeveIfStatement
+ " And " & Left(rsMasterSepSleeve!Prod_No, 6) & " <> " &
rsProdFam!AddH_Prod_Fam
Count = Count + 1
End If
rsProdFam.MoveNext
Loop
If SepSleeveIfStatement Then
rsMasterSepSleeve.Delete
End If
I am trying to build an if statement that is built by
checking equality. Can you tell me why the following code
below has a data type error when I run it. What can I do
to fix the loop.
rsProdFam.MoveFirst
Count = 0
'Build if statement
Do While Not rsProdFam.EOF
If rsProdFam!Description = "Sep Sleeve" And Count
= 0 Then
SepSleeveIfStatement = Left(rsMasterSepSleeve!
Prod_No, 6) & " <> " & rsProdFam!AddH_Prod_Fam
Count = Count + 1
ElseIf rsProdFam!Description = "Sep Sleeve" And
Count > 0 Then
SepSleeveIfStatement = SepSleeveIfStatement
+ " And " & Left(rsMasterSepSleeve!Prod_No, 6) & " <> " &
rsProdFam!AddH_Prod_Fam
Count = Count + 1
End If
rsProdFam.MoveNext
Loop
If SepSleeveIfStatement Then
rsMasterSepSleeve.Delete
End If