keeping a visible field change on a form in access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alostboy01
    New Member
    • Jan 2015
    • 1

    #1

    keeping a visible field change on a form in access

    I have written some code using VBA that hides certain fields when options are selected in the form.

    It works in the first instance but if I go back to the record again later the fields have all re-appeared again. I need to re-select the options and the fields I want to get the right fields to disappear again.

    How do I get this to happen without re-clicking fields?

    Russell
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    It sounds like your decisions are based on objects on the screen that are not saved in the data. Or else your instructions to hide the fields are not being run when you need them to.

    What event are you using to run the hide instructions? Try putting your instructions in the OnCurrent event of the form. That way the code is run every time you advance to a new row.

    You probably want to put this code in a subroutine and then call that subroutine from the OnCurrent event of the form and also from each object's AfterUpdate event for those objects that affect the appearing/hiding of the fields.

    Jim

    Comment

    Working...