Full Version: Code problem - Select case!
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
markhagger
I am using the following code to show and hide fields depending on what value you select on a form. the problem i have is when your use the navigation buttons to move through the records, the fields do not update as this is a select script (if you get what i mean)

I have the code sitting in the "after update" control field.

is there anyway of changing this so it will work when ever the value is changed.

CODE
  Select Case Outcome.Value

    Case Null 'if blank
        
        Date_Debited_Label.Visible = False
        Date_Debited.Visible = False
         Placed_With.Visible = False
        Placed_With_Label.Visible = False
        Secured_Premuim.Visible = False
        Secured_Premuim_Label.Visible = False

    Case "Not Taken Up"
        
        Date_Debited_Label.Visible = False
        Date_Debited.Visible = False
         Placed_With.Visible = False
        Placed_With_Label.Visible = False
        Secured_Premuim.Visible = False
        Secured_Premuim_Label.Visible = False
niesz
Add this code to the OnCurrent event of the form.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.