Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ENABLED property in CONTINOUS FORM 2

Status
Not open for further replies.

ZaZa

Technical User
Sep 5, 2001
85
US
Hi everyone,

I'm throwing out this question again hoping Someone has a helpful answer:

I have a form in continous view and I want to set the Eabled property of two fields in the CURRENT RECORD to fasle if a checkbox the same record is ticked. The underlying table is like this

TblTwo
---------
EquipId
Returned ( This is a check Box)
ReturnDate
ConditionOf Equip
etc etc

I know how to ste thebenabled property of the [ReturnDate] and [ConditionOf Equip] fields to fasle by using the after update event procedure for the checkbox.

PROBLEM IS that this disables ALL THE [ReturnDate] and [ConditionOf Equip] fields in ALL THE RECORDS. I just want to Diasble these two fields FOR THE CURRENT RECORD BEING EDITED.

Any Ideas anyone? or maybe I an not explaining properly....

ZAZA
 
Seems to me you want to set the enabled properties of those fields False in the After Update event of the checkbox control, and then reset them in the Current event of the form like


Code:
Private Sub Returned_AfterUpdate()
    me.ReturnDate.enabled = False
    me.ConditionOfEquip.enabled = False
end sub

Private Current()
    me.ReturnDate.enabled = True
    me.ConditionOfEquip.enabled = True
end sub

Hope this helps! David 'Dasher' Kempton
The Soundsmith
 
Hi!

David has you most of the way there. The only thing I would add is, in the Form_Current procedure, you will need to check the status of the check box to determine if the text boxes need to be enabled or not. And in the AfterUpdate procedure, you will also need to check the status of the check box.

hth
Jeff Bridgham
 
Thanks guys,

I did what you both suggested and I have it working well enough. The on current event was completely overlooked. Thanks for pointing it out.

I know that this sounds dumb but I was also expecting the grayed-out effect to only apply to the current record which did not have the check box ticked. So that if someone looked at previous records they would see some [ReturnDate] and [ConditionOf Equip] fields grayed-out and others white depending on if the checkbox was clicked or not. If you have any thoughts about this I would like to hear it, otherwise thanks.

Zaza

 
ZaZa, it sounds like you're using Access '97. In '97 Continuous Forms, you cannot change properties for individual records, you can only change values.

It's probably possible to achieve the exact results you want by adding a host of unbound fields, but it gets pretty messy.

I've heard that Access 2000 suports Conditional Formatting in Continuous forms.

HTH
 
Thanks Boxhead,

You are right-Iam using access97. Just didn't know if it was was possible to do what I wanted. Now I know.

ZaZa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top