Setting field value if a value exists in another table

R

RussCRM

I work for a shelter and occasionally we have to ask a guest to leave
for some reason. We call this being "barred" from our services. When
a staff person opens the main data entry form, based on "tblGuest",
there is a subform on a tab where this information can be entered. If
a guest is barred, a record is placed using the subform in
"tblBarInformation". The fields in this table are "BarID",
"BarLink" (equal to GuestID from tblGuest), "BarDate", and
"BarExpireDate."

Basically, I want to create a field in tblGuest that indicates the
guest's status as Barred if there is a current bar record in
tblBarInformation. So far, I've created a query such as this:

Field: BarID BarLink BarCurrent: [BarExpireDate]
Totals: GroupBy Group By Last
Criteria: >=Date()

This gives me all the bars that are current as of today. I want to
use this information to update the guest table somehow if the guest
has a current bar. I can't trust staff people to do this as they
aren't always on top of things.

Could I could create some kind of update query that runs when the main
form is opened to that guests record and that would set the status in
Guest? Or, should I somehow run an event in the subform when data is
updated there?

Thanks!

Russ
 

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