VBA query

J

John Reynolds

I am looking at some vba and am totally new to it, what is
the below statement saying in lay terms.

Can someone break it down for me...


If wl![prov_code] = "RNE01" Then
If Left$(wl![ABC], 1) = "1" Then
ABC_date = Right$(wl![ABC], 2) & "/" & Mid$(wl![ABC], 5,
2) & "/" & Mid$(wl![ABC], 3, 2)
End If
 
D

Douglas J. Steele

Not sure what wl is, but I'm assuming it's either a form object, or a
recordset.

If the value of [prov_code] (which will be a control on the form, or a field
in the recordset) is RNE01, and the left-most character of [ABC] is the
digit 1, then set variable ABC_Date equal to the last 2 characters of [ABC],
followed by a slash, followed by the 5th and 6th characters of [ABC],
followed by a slash, followed by the 3rd and 4th characters of [ABC]

Sounds like [ABC] contains a date under certain conditions only.

(bottom line is it's bad code if it doesn't have comments explaining what
it's doing!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top