Since there are no control arrays in VBA (that I know of...) I'm using a for loop with the eval function to try to clear out some labels... for whatever reason, I get an error message stating
"Microsoft Access can't find the name lblFname0 you entered in the expression"
however, that is the correct name for the label I want to access...
here's my code:
For i = 0 To 14
Eval("lblFname" & i).Visible = False
Eval("lblFname" & i).Caption = ""
Eval("lblLname" & i).Visible = False
Eval("lblLname" & i).Caption = ""
Eval("lblType" & i).Visible = False
Eval("lblType" & i).Caption = ""
Eval("lblPhone" & i).Visible = False
Eval("lblPhone" & i).Caption = ""
Eval("cmdContact" & i).Visible = False
Eval("lblContactID" & i).Caption = ""
Eval("lblSubID" & i).Caption = ""
Next
Any clues as to why this isn't working? I'm using Access 2000.
Thanks for any help!
Hopper
"Microsoft Access can't find the name lblFname0 you entered in the expression"
however, that is the correct name for the label I want to access...
here's my code:
For i = 0 To 14
Eval("lblFname" & i).Visible = False
Eval("lblFname" & i).Caption = ""
Eval("lblLname" & i).Visible = False
Eval("lblLname" & i).Caption = ""
Eval("lblType" & i).Visible = False
Eval("lblType" & i).Caption = ""
Eval("lblPhone" & i).Visible = False
Eval("lblPhone" & i).Caption = ""
Eval("cmdContact" & i).Visible = False
Eval("lblContactID" & i).Caption = ""
Eval("lblSubID" & i).Caption = ""
Next
Any clues as to why this isn't working? I'm using Access 2000.
Thanks for any help!
Hopper