Populate one combo box based upon value of another

B

bw

When I open my form, I get the following "Enter Parameter Value"
box....[form]![PhoneDirectory]![cboDirectory], and if I enter 1 in the box,
then cboDeptName is populated with the correct values (when the DirectoryID
of cboDirectory = 1), otherwise, cboDeptName is "empty".

The Control Source for cboDeptName is DeptName
The Row Source for cboDeptName Row Source is as follows:

SELECT [zDepartments Query].DeptID, [zDepartments Query].DeptName,
[zDepartments Query].DirectoryID, [zDepartments Query].Directory
FROM [zDepartments Query]
WHERE ((([zDepartments
Query].DirectoryID)=[form]![PhoneDirectory]![cboDirectory]));

Since I don't know why this is not working, I'm not sure what other
information you may need to help me.

Can someone give me a hint as to what's wrong here?

Thanks,
Bernie
 
R

Rick Brandt

bw said:
When I open my form, I get the following "Enter Parameter Value"
box....[form]![PhoneDirectory]![cboDirectory [snip]

That should be...

[forms]![PhoneDirectory]![cboDirectory

(note the "s" on forms)
 
B

bw

Well, that helped. At least I can see the values when the DirectoryID of
cboDirectory = 1. But for any other value, cboDeptName is "empty".

Another hint please?
Thanks,
Bernie

Rick Brandt said:
bw said:
When I open my form, I get the following "Enter Parameter Value"
box....[form]![PhoneDirectory]![cboDirectory [snip]

That should be...

[forms]![PhoneDirectory]![cboDirectory

(note the "s" on forms)
 
R

Ron2005

I believe what I had to do on a similar situation was to perform a
requery on the combobox when the id that it was dependent on changed
(if dropdown) or after update for other type.

The alternative was to do a requery on the combo box whenever the
combobox got focus (and a refresh would probably not hurt either).
Ron
 

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