Specific selection

pm4698

Registered User.
Local time
Today, 22:46
Joined
Jan 23, 2010
Messages
72
Hello there..

I have a form in which i have combo boxes. The combo boxes are drop down menus from a field of table called lastnames.

All i want is that when all these combo boxes have a selection in, to have a table in the form, where the rest lastnames (that are not selected at the combo boxes), will show up.

Can you help me at this?

Thanks in advance
 
If I have understood the problem:
Use this statement as the RecordSource of a subform

SELECT *
FROM tablename
WHERE lastname <> Forms!formname.combo1 AND lastname <> Forms!formname.combo2 etc

Requery the subformcontrol in the AfterUpdate event of the combos.
 
So, because i am a rookie at access, all i have to do is:

Inside the form, select the new subform button.
I will insert the field lastname from the table Employee in the subform

When you say "Use this statement as the RecordSource of a subform" what i must do exactly?

and where should i put this code:

SELECT *
FROM tablename
WHERE lastname <> Forms!formname.combo1 AND lastname <> Forms!formname.combo2 etc

and when you say to: "Requery the subformcontrol in the AfterUpdate event of the combos." what i must do exactly?

Thank you in advance and really sorry for the lots of questions
 
Objects in Access have Properties. Highlight your new subform control on the main form and right click. Click Properties to show the properties window.

The Record Source is the first one on the Data tab. Substitute the names of your objects in the sql statement I posted. Otherwise you can click the right hand end of the property box and it will open the query builder so you can construct the query yourself.

Highlight one of the combos and look in the Events tab of its properties to find After Update. Click on the right hand end of the property and it will open a dialog. Click code builder and it will open VBA editor with a procedure template for the event.

In that procedure type:
Me.subformname.Requery

Repeat for the other combos.
 

Users who are viewing this thread

Back
Top Bottom