G
Guest
I have two different forms, each has the same set of controls for entering
payment information. One control is an option box to select payment method -
cash, check, or credit. The other is a control to enter a check number. The
way it is set up is that the Check No control is not visible, and the OnClick
event of the payment method option box checks if the payment method is
"Check", and if it is makes the Check No control visible, moves focus to the
Check No control and changes the label of the Check No control to Red & bold.
The code is the same in both forms :
If Me.txtPmtMethod = 2 Then
Me.txtCheckNo.Visible = True
Me.txtCheckNo.Enabled = True
Me.txtCheckNo.Locked = False
Me.lblCheckNo.ForeColor = 255
Me.lblCheckNo.FontSize = 10
Me.lblCheckNo.FontWeight = Bold
Me.txtCheckNo.SetFocus
Else
Me.txtCheckNo.Visible = False
Me.txtCheckNo.Enabled = False
Me.txtCheckNo.Locked = True
Me.lblCheckNo.ForeColor = 0
Me.lblCheckNo.FontSize = 8
Me.lblCheckNo.FontWeight = normal
End If
One of the forms works fine. In the other one, when I select Check as
payment method, I get an error message:
Complie Error:
Variable not defined
And the debugger points to the line of code:
Me.lblCheckNo.FontWeight = Bold
With "Bold" highlighted.
If I comment that line of code, I get the same error and the debugger shows:
Me.lblCheckNo.FontWeight = normal
With "normal" highlighted.
Again, the two controls on both forms are identical, with the same
properties, and the code was cut and paste from the first form to the second.
It is the second form that is giving the errors.
Any Ideas?? Thanks -- Garry Gross
payment information. One control is an option box to select payment method -
cash, check, or credit. The other is a control to enter a check number. The
way it is set up is that the Check No control is not visible, and the OnClick
event of the payment method option box checks if the payment method is
"Check", and if it is makes the Check No control visible, moves focus to the
Check No control and changes the label of the Check No control to Red & bold.
The code is the same in both forms :
If Me.txtPmtMethod = 2 Then
Me.txtCheckNo.Visible = True
Me.txtCheckNo.Enabled = True
Me.txtCheckNo.Locked = False
Me.lblCheckNo.ForeColor = 255
Me.lblCheckNo.FontSize = 10
Me.lblCheckNo.FontWeight = Bold
Me.txtCheckNo.SetFocus
Else
Me.txtCheckNo.Visible = False
Me.txtCheckNo.Enabled = False
Me.txtCheckNo.Locked = True
Me.lblCheckNo.ForeColor = 0
Me.lblCheckNo.FontSize = 8
Me.lblCheckNo.FontWeight = normal
End If
One of the forms works fine. In the other one, when I select Check as
payment method, I get an error message:
Complie Error:
Variable not defined
And the debugger points to the line of code:
Me.lblCheckNo.FontWeight = Bold
With "Bold" highlighted.
If I comment that line of code, I get the same error and the debugger shows:
Me.lblCheckNo.FontWeight = normal
With "normal" highlighted.
Again, the two controls on both forms are identical, with the same
properties, and the code was cut and paste from the first form to the second.
It is the second form that is giving the errors.
Any Ideas?? Thanks -- Garry Gross