Unhide a Bound Field based on a Lookup Field

Posted on 2006-05-26
Last Modified: 2006-11-18
I have a Lookup field which includes a "Worker's Compensation" record (selection). I want one of my bound fields (Claimant) to remain hidden until "Worker's Compensation" is selected. If a different selection is made subsequently, I then want the Claimant field to hide itself once again.

So in other words, the Claimant's field should only be present when "Worker's Compensation" is the current selection.
Question by:danthemanjr
    LVL 65

    Assisted Solution

    on the gotfocus event of Workers_Compensation, u can unhide

    on on form_load

    myfield.visible = false

    private sub workerscompensation_gotfocus()
        myfield.visible = true
    end sub

    private sub workerscompensation_lostfocus()
        myfield.visible = false
    end sub
    LVL 6

    Accepted Solution

    On the AfterUpdate event of the Lookup field:

        If (Me.LookupField= "Worker's Compensation") Then
           ClaimantField.Visible = True
          ClaimantField.Visible = False
        end if

    Author Comment

    Thank you both...Great Answers!!!!

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now