• saving records (Acc 97)

    Author
    Topic
    #374573

    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

    Viewing 1 reply thread
    Author
    Replies
    • #606297

      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.

    • #606298

      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:[indent]


      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.


      [/indent]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.

      • #606305

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

    Viewing 1 reply thread
    Reply To: saving records (Acc 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: