Hello, I am making an Access database and I have a problem that I'm not sure how to solve.
I have a main form, which looks at records from a main table. All other tables in the database contain records, and each of those records pertains to one particular record in the main table. That is to say, all other tables exist in many-to-one relationships with the main table.
The main form has a subform which displays one record at a time from one of those other tables, specifically, records that correspond to whichever record the main form is displaying. Let's call the record that this subform is looking at 'Record A'. All fairly simple so far.
Now, on the subform, I have two checkboxes. They aren't for the user, these are automatic. One is for "Before an event" and one is "After an event". I want them to be automatically checked on or off, depending on whether records exist in a table (a list of events that correspond to records in the main table) that suit some requirements. Consider Record X, in this third table of events. Record X suits the requirements if:
However, I don't know how to do it. I played with Count() and some queries and things but I got hopelessly lost. Can anybody help me?
Thanks very much in advance,
Maelin
I have a main form, which looks at records from a main table. All other tables in the database contain records, and each of those records pertains to one particular record in the main table. That is to say, all other tables exist in many-to-one relationships with the main table.
The main form has a subform which displays one record at a time from one of those other tables, specifically, records that correspond to whichever record the main form is displaying. Let's call the record that this subform is looking at 'Record A'. All fairly simple so far.
Now, on the subform, I have two checkboxes. They aren't for the user, these are automatic. One is for "Before an event" and one is "After an event". I want them to be automatically checked on or off, depending on whether records exist in a table (a list of events that correspond to records in the main table) that suit some requirements. Consider Record X, in this third table of events. Record X suits the requirements if:
- Record X corresponds to the same item on the main table as Record A
- The 'date' field of Record X is before (or after, depending on the checkbox) the date of Record A
However, I don't know how to do it. I played with Count() and some queries and things but I got hopelessly lost. Can anybody help me?
Thanks very much in advance,
Maelin