View Full Version : Filters


kermit5
01-22-2002, 12:28 PM
I have a form that is set up as follows:

When the form opens, the cmbProjectName is used to select a project that corresponds to the Name selected. For example, if the user selects My House in the combo box, the nth record (the "My House" record) and all of it's information is displayed on the form. The problem that I have is that the user may inadvertantly change to the xth record and change data for this record.

How do I filter my form so the only record available for editing (or deleting) is the record selected by the user using the combo box? That is to say, even though my table may have 800 total records, when the user selects a PROJECT NAME, how do I set it up so the record selector on my form would say "Record 1 of 1 (Filtered)" thereby disabling inadvertant changes to other records?

Pat Hartman
01-22-2002, 05:10 PM
You need two instances of the ProjectName combo on the form. One to use for selecting records and the other for viewing/entering ProjectName. In the Current event, you can check the NewRecord property. If the record is "new" then the second ProjectName field should be available for data entry. If the record is not "new", this field should be locked and disabled to prevent changes to existing data.