With ... End With

aziz rasul

Active member
Local time
Today, 14:18
Joined
Jun 26, 2000
Messages
1,935
'With rst1
Do While x < countrecords
fieldname = rst2![Field Name]
fieldname1 = "[Audit File - " & fieldname & "]"
fieldname2 = "[NTL Data - " & fieldname & "]"
f1 = rst1(fieldname1)
f2 = rst1(fieldname2)
If f1 = f2 Then
...
End If
rst1.MoveNext
Loop
'End With

How do I change the syntax for f1 and f2 if I introduce the With...End With statements? The varaibles f1 and f2 should give the values of the fielsnames fieldname1 & fieldname2.
 
f1 = .Fields (fieldname1)
f2 = .Fields (fieldname2)

did the trick. Thanks Fornation.
 

Users who are viewing this thread

Back
Top Bottom