I am just getting started with VBA and I'd appreciate any help anyone
can offer here. I am trying to use VBA to look through the "Curr Year"
column in table "tblYear" and check whether the value "2006" is in any
of the fields for that column. Here's the code I have so far...
Private Sub UpCurYr_Click()
Dim db As Database
Dim tdf As TableDef
Dim X As String
Set db = CurrentDb()
Set tdf = db.TableDefs("tblYear")
Set X = 2006
If tdf.Fields("Curr Year") = X Then
MsgBox ("You got it")
End If
End Sub
The MsgBox is just to check if the code works. If anyone knows of a
good VBA introductory examples page please let me know.
Thanks everyone...