.enabled

iankerry

Registered User.
Local time
Today, 19:44
Joined
Aug 10, 2005
Messages
190
hi

hope someone can help!

i have two currency fields "inc due" and "inc due less VAT".

when another field (called "locked") is ticked I want to not enable these fileds so folk can see them but not change them.

So I use this:

If Me.locked = -1 Then [Inc Due].Enabled = False

This works well. but THE PROBLEM:

when i try the same line with "inc due less VAT", instead of being able to choose .ENABLED I can only choose .VALUE.

Why is this? The fields seem identical?

Thanks

Ian Kerry
 
first off, spaces in object names are a bad idea.

second, locked is also an object property, you should change the name of this object.

third, on the On_Update event for your checkbox, simply set the two fields to the inverse of the check box:
Code:
incDue.Enabled = not(chkLocked)
incDueLessVAT.Enabled = not(chkLocked)
 
Last edited:
Hi

Thanks very much for replying.

1. There are so many fields in the database with spaces in that I haven't dared change them all, as it will also affect reports and queries etc. I don't think that this is causeing my problem anyhow, as both fields have spaces in them, and one works and the other doesn't.

2. I have changed the name locked to reconciled. but it hasn't made any difference.

3. I am afraid I didn't understand this - firstly I don't have an on_update, only a before and after. I tried it on both of the these - but I am not sure what you mean by chkLocked. What is it?

Sorry for being dense.
Ian
 
that would be my fault...too early in the morning:o put it in the click event of the check box.

chkLocked is what I called the check box in my example.
Code:
Private Sub reconciled_Click()
    Me.Inc_Due.Enabled = Not (reconciled)
    Me.inc_due_less_VAT.Enabled = Not (reconciled)
End Sub
 
i seem to get a compile error "method or datamember not found" and it highlights the name of the field promopaidreconciled - which is the checkbox name

Me.Actual_Promoter_Fee.Enabled = Not (promopaidreconciled)

Any ideas? Also given that my field does have spaces in can I not just put [ ] around them?

Thanks

Ian
 

Users who are viewing this thread

Back
Top Bottom