dynamic selective lookups???

T

TC

If the number if valid combinations is small, I guess you could store those
conmbinations in a seperate table, & enforce a relationship from the M:M
junction table, to the new validation table?

HTH,
TC
 
T

TC

Yes, an excellent suggestion, and one that seems quite apparent now, but
certainly did not before!

While it denies the invalid combinations, it does not limit the available
choices up front. I suspect that what I say that I want is not possible, at
least not without undue complication.

Say the form in question has two combo boxes A and B for the fields in
question. The AfterUpdate event of combo A, could *repopulate* combo B with
just the legitimate values - no others. (You could do this by populating
combo B from a function, not a table/query/SELECT statement. Details of how
to do this are in online help. Search for symbol lbEnd, or aclbEnd - I can't
remember which.) However, it could be tricky to get this right, since the
user might enter the fields in either order.
I shall implement your solution, and I thank you!

No probs :)

TC
 
T

TC

Both!

txtBlah_AfterUpdate applies to the field.

Form_AfterUpdate applies to the form (ie. the record).

There is a BeforeUpdate at each level, as well.

You can cancel (ie. refuse) the pending update from the Before events, but
not from the After ones - it has been accepted, by then.

HTH,
TC (off for the day)
 
A

annie

This situation has arisen a number of times among my database projects, and
I have not come close to even having an idea of how to address it.

I have resolved a many-to-many logical relationship between two tables by
inserting an intermediate table to which each of the original tables has a
one-to-many relationship. Let's assume that the keys in the original tables
are single-field, so that means that the key in the intermediate table is a
two-field composite (each indexed, duplicates ok).

I'd like to be able to deny the user certain specific combinations of field
values when they create records in the intermediate table. Because I'm a
purist, I don't want to detect a denied combination after the fact with a
query; I'd rather have the allowed selections for the second entered field
limited on the basis of the value in the first entered field. I'd rather
avoid a problem than have to react to one.

Any comments or suggestions???

Thanks!!!
 
A

annie

Yes, an excellent suggestion, and one that seems quite apparent now, but
certainly did not before!

While it denies the invalid combinations, it does not limit the available
choices up front. I suspect that what I say that I want is not possible, at
least not without undue complication.

I shall implement your solution, and I thank you!
 
A

annie

Does AfterUpdate apply just to the field or to the record? If to the
record, then that won't work since both fields are part of the key. I hope
it applies to the field!!!
 

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