Validation across Tables

W

WestWingFan

Thanks in advance for the help.

I need advice about the best way to do some validation across tables. I'll
explain the setup below and what I'd like to have happen.

I have two tables (questions and alignment type). The relationship is one to
many from questions to alignment type. Alignment type has a double primary
key with questionID and knowledgeID.So, for ease of the users, I put them
onto a form and subform. The main form (based on the question table) contains
a option group which dictates what other parts of the form show and what data
they display. (I can function in VBA, but it's all been self-taught and
therefore a bit spotty. I can do that, but not code in the validation - hence
my post.) The knowledge ID for the alignment type subform comes from an
unbound listbox (on the main form), which writes to the alignment type table
when a command button is pressed.
The subform displays three fields (KnowledgeID, level, and degree).

Ok, So here goes on a description of what I'd like to happen.
If the option group on the main form/table has choice 1 selected, then I'd
like the user to only be able to record to the alignment type table those
knowledgeID's that are level 1 (information is found in a twice removed
table, so I created a query to lookup the level easily). These entries should
not have a alignment degree.
If the option group on the main form has choice 2 selected, then I'd like
the user to only be able to record to the alignment type table those
knowledgeID's that are level 2 or higher. These entry's should have an
alignment degree.
If the option group on the main from has choice 3 selected, then the user
should not be able to record any information to the alignment type table.
If the user changes the option group from one choice to another, I'd like
the new option to deleted the old information.

So, I think this all goes in the "before update" event of the main form, but
I'm lost after that (and of course my boss want's this sooner than later).

Help!
 

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