SelectActiveRecords

K

Kenny G

Hello,

I have a form called Main and there is a table called main under this form.
There is a field called ReportingOfficer on that form. There is a table
under this field (Reporting Officer) that consists of four fields from the
table (tblOfficer). see below

tblOfficer
BadgeNumber text
OLName text
OFirstInitial text
Inactive checkbox

Of those four fields in tbl Officer three are included to make up the field
in tblMain.ReportingOfficer.

My problem is - if the checkbox (inactive) is checked I do not want the
officer's name to available for selection. What do I need to do to ensure
that only active officer's will be chosen.

Thank You, Kenny G
 
J

Jason

I'm not sure if I follow what you are asking (not being able to see your form
and all). It sounds like you have a combo box on your form that allows you
to select an officer. If this is the case, you can set the RowSource for the
combo box to a query
based on your tblOfficer table. In the query just set the criteria under
the checkbox to "No". Then the combo box should only display the officers
who dont have that box checked.

If you mean to say that you don't want your users to see the records for
those who are inactive as they are scrolling through the different records,
then you could base your entire form on the same type of query rather than
straight from the table. Hope that helps!!!
 
K

Kenny G

Jason,

Many thanks! That did it.

Kenny G

Jason said:
I'm not sure if I follow what you are asking (not being able to see your form
and all). It sounds like you have a combo box on your form that allows you
to select an officer. If this is the case, you can set the RowSource for the
combo box to a query
based on your tblOfficer table. In the query just set the criteria under
the checkbox to "No". Then the combo box should only display the officers
who dont have that box checked.

If you mean to say that you don't want your users to see the records for
those who are inactive as they are scrolling through the different records,
then you could base your entire form on the same type of query rather than
straight from the table. Hope that helps!!!
 
Top