0

I'm working on an Access database that has a main table that keeps track of basic user information and several sub-tables that have a one-to-many relationship to the main. Now all users are in one of two groups, which they can move between, and half of the tables only apply to one group. Which group a user is in is determined by a Boolean.

How I intended to set up the the various forms and sub-forms was to have the main form based on the queries:

SELECT *
FROM Foo
WHERE InGroup1 = TRUE

and

SELECT *
FROM Foo
WHERE InGroup1 = FALSE

and then add the appropriate sub-forms.

However, what keeps happening is that if there isn't a record in the sub-table associated with the currently selected ID of the main table, it just displays the first record in the table.

If I make a main form not based on a query it works fine, but then the two groups are mixed together.

Is there a way around this?

1 Answer 1

0

I cannot reproduce your problem. This is an example of a form and subform where the subform data does not contain a record for the main form. The main form is based on a query:

 SELECT * FROM groups WHERE  ingroup1 = true

And is built in MS Access 2010.

sample form/subform

2
  • Well I just tried it again and it didn't work. So, clearly I'm making a different mistake. I'll try some more different things then edit my question. Aug 15, 2012 at 4:45
  • It is often worthwhile to compact & repair and decompile, after you have backed up. Oddities can creep in while you are developing. You could also try an outline on a fresh database to ensure that it is not something around this development that is causing a problem.
    – Fionnuala
    Aug 15, 2012 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.