Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    London, Gtr London, England
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    saving records (Acc 97)

    Help, I am a bit rusty and this is urgent!!!

    I have a continuous form with multiple records. I want to disable a text field depending on the value a field on the current record.
    Whenever I do this, it disables all instances of this field for all records. Is there an easy way of disabling items for the current record??

    tia,

    Jonathon

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: saving records (Acc 97)

    When you have a continuous form, you really only have one of each control so when you disable it, you do it in each record.

    However, if you put the code that decides whether it should be disabled or not in the 'oncurrent' event then it should be able to enable the control when you want it, and disable it when you don't.
    Regards
    John



  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: saving records (Acc 97)

    John Hutchinson already gave you the explanation. Here it is from MS itself. The following is from KB article ACC: Changing Control Properties Affects All Records in a Form:
    <hr>Changing a control's property setting (such as the BackColor property setting) in a continuous form causes all instances of that control in all records to be changed.

    Microsoft Access stores a single set of property settings for each control on a form. In order for a control to appear differently from record to record on a form, Microsoft Access would have to store and maintain property settings for each control for every record in the form.

    If a control has approximately 50 property settings, a form with 1000 records would need to maintain 50,000 property settings. Maintaining this much information for controls would severely impact performance.<hr>
    So there's not much to be done about it. If you put the code to enable/disable the control in the OnCurrent event procedure, you still have this visually undesirable behavior, but the status of the control will be correct for the current record.

  4. #4
    Star Lounger
    Join Date
    Jun 2002
    Location
    London, Gtr London, England
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: saving records (Acc 97)

    thanks you two - two options to get me out of the hole I was in. Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •