Read only fields in a continous form based on query results

Posted on 2012-09-12
Last Modified: 2012-09-14
I have the following continous form

Project | Baseline_Hours | Revised_Hours

This form pulls data from a table with the same field names

I also have another table (named Baselined_Projects) with a list of project names, which is a subset of Project names shown in the form/table described above

What I want to do is, for each record (on current event), to make Baseline_Hours read-only if the Project name is listed in the Baselined_Projects table...

Any idea?
Question by:fitaliano
    1 Comment
    LVL 61

    Accepted Solution

    Try this in the forms current event:

    Me.Basline_Hours.Locked = (DCount("*", "Baselined_Projects", "[Project Name] = '" & Me.[Project Name] & "'") > 0)

    Open in new window

    Adjust the field and table names if needed to match your own database.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    779 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

    9 Experts available now in Live!

    Get 1:1 Help Now