Read only fields in a continous form based on query results

Posted on 2012-09-12
Medium Priority
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

mbizup earned 2000 total points
ID: 38392942
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.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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