disable text box (1 Viewer)

dp111443

New member
Local time
Today, 15:15
Joined
Oct 30, 2002
Messages
7
Hi,

I have used the following code to grey out a text box (Date Accepted) at all times except when the item in the Quote status is "Accepted".

-------------------

Private Sub QuoteStatus_AfterUpdate()

If Me!QuoteStatus = "Accepted" Then
Me!AcceptedDate.Enabled = True
Else
Me!AcceptedDate.Enabled = False
End If

End Sub

-------------------

This code works fine expect when you move to a different record or save it. the accepted date field should still be disabled as the value for quote status hasn't changed, but instead it allows the user to type a date in anyway whether or not the quote status is "Accepted" or not.

I would appreciate some help on this small problem.

Thanks.
 

Fuga

Registered User.
Local time
Today, 16:15
Joined
Feb 28, 2002
Messages
566
I´m not sure, but if you put the code as an on_current event of your form, will that do the trick?

Fuga.
 

dp111443

New member
Local time
Today, 15:15
Joined
Oct 30, 2002
Messages
7
Absolutely great!! yeap that worked a treat.

Thanks for your help.

Fuga, could you have a look at one of my earlier posts i sent yesterday evening after 4pm please? If you can't answer it then its ok but you have more experience than me and you may have come across the problem before.

Thanks again.
 

Fuga

Registered User.
Local time
Today, 16:15
Joined
Feb 28, 2002
Messages
566
I´ve read the other post, but I´m afraid I can´t help you there.

But relax, I´m sure someone can tell you what´s going on.:)

It might help if you give more details.

Fuga.
 

dp111443

New member
Local time
Today, 15:15
Joined
Oct 30, 2002
Messages
7
"You can't assign value to this object"

Hi,

Ok heres the error that Im getting...

-------
You can't assign a value to this object.

* The object may be a control on a read-only form.
* the object may be on a form that is open in Design view
* The value may be to large for this field.
-------

The problem in more detail is...

Everytime I create a new record in my quote form, I get the above silly error whenever I try to select/input a value from any object on that form regardless it being a drop down, text box, etc. The weird thing is I get the error...I click OK to make it go away...I get the same error...I click OK...I get the same error....and I click OK (three times). Once I've done that I can carry on as normal filling out details in my form objects no problem and save the record no problem.

The form has no VB coding behind it...its just a simple form with subforms within it, all done from the access wizard.

The error message also doesn't have an access error number so cant find out anything in the help either.

Can anyone help with this problem please.

Thank you so much.
 

Users who are viewing this thread

Top Bottom