--TripWire--
asked on
MS Access Form - Runtime error 2135
I have a VBA project and I want one of the text boxes on the form
to become zero when the user clicks a certain command button.
But, I am getting...
But when I look at that text box's properties
Enabled = Yes, Locked = No
The code I have is in the OnClick event...
to become zero when the user clicks a certain command button.
But, I am getting...
Run-timer error 2135
This property is read-only and cannot be set
But when I look at that text box's properties
Enabled = Yes, Locked = No
The code I have is in the OnClick event...
chkboxPaid.Value=True
Text54.SetFocus
Text54.Text="0"
what is the ControlSource for the textfield ??
And you should use Text54 = "0"
as the property .Text is only accessible when you are editing the TextBox
And you should use Text54 = "0"
as the property .Text is only accessible when you are editing the TextBox
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
I tried Text54=0 but problem still persists.
The control source of the txtbox is...
I tried Text54=0 but problem still persists.
The control source of the txtbox is...
=IIf([Insurance] = "X", ([Total]-(0.15*[Total])-[Payment], ([Total]-[Payment]))
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok thanks. Good to know.
Can you suggest some other way to get that figure to zero? I tried a nested IIf, but it does nothing.
=IIf([Paid]="Yes", 0, IIf(....etc...))
Can you suggest some other way to get that figure to zero? I tried a nested IIf, but it does nothing.
=IIf([Paid]="Yes", 0, IIf(....etc...))
Under what condition is it supposed to be Zero ?
mx
mx
ASKER
It's the user's choice.
The way I have it now is they click a command button, which sets a yes/no box to true.
And from now on, whenever the DB see's that Paid=true, the remaining balance goes to 0.
The way I have it now is they click a command button, which sets a yes/no box to true.
And from now on, whenever the DB see's that Paid=true, the remaining balance goes to 0.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's what I have. Does nothing so far.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nevermind, I had quotes around Yes.
Thanks - problem solved.
Thanks - problem solved.
Cool.
thx.mx
thx.mx
chkboxPaid.Value=True
Text54.SetFocus
Text54 ="0"