Passing variables from multiple records

H

HeatherD25

I have a form that displays a list of facilities that are assigned to a user
(it brings up the list based on the username they enter when logging into the
database). They could have one or many records listed on their form.

I want them to be able to select a checkbox next to each facility if they
want to see all of the records related to the facility they select. I
created a field called "VIEW_STATUS" for the checkbox. The facility field is
called FACILITY.

I can't figure out how to send multiple values of facility/view status as
the filter. To pass the first instance I think I can use (side note - am I
passing the true/false value correctly? I was getting an error.):

stLinkCriteria = "FACILITY_ID = " & Me.FACILITY_ID.Value & " AND " &
"VIEW_STATUS='True'"

How can I make this send ALL of the rows?

Thanks!!!!
Heather
 
N

NetworkTrade

assuming that the checkbox is a permanent field/column in your 'facilities'
table:

make a new Query1 sourced on the Facilities table ...and set the checkbox
column criteria to 'Yes'

this Query1 will return records only for those now that are checked (a
cursor left alive in a form record will not be included unless you manipulate
'Dirty')

create a new Query2 that has the Status table and Query1. make a join
between them with the crossreferencing field with join property set to All of
Query1 and only those of Status that correspond.

Query2 will now display records of Status table that correspond to Query1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top