Automate ComboBox

Dina01

Registered User.
Local time
Today, 10:52
Joined
Apr 24, 2002
Messages
87
Hello,

I have a Form named "Ecran_PCP_form" and I have a combobox that is independent but the source is

SELECT DISTINCTROW tblUsers.User, tblUsers.Password FROM tblUsers;

Then I have a list box that the source is
SELECT tblUsers.User FROM tblUsers WHERE (((tblUsers.User)=[forms]![Ecran_PCP_form]![User]));

What I would like to do is that when I choose a username from the combobox named " User" then my list named "CodeSupervisor" should show me the data...But it doesn't work....

Does anyone have any clue on how to do this...
 
I think you just need to requery the list box ...

Me.CodeSupervisor.Requery


... in the AfterUpdate of the combo box...

HTH
Chris
 
I already tried that and still didn't work......
 
Hmmm

Try to remove the row source from the property page of the listbox,
then let's try to assign the rowsource in the after update of the combo box


Me.CodeSupervisor.RowSource = "SELECT tblUsers.User " _
& "FROM tblUsers WHERE (((tblUsers.User)= '" _
& Forms!Ecran_PCP_form!User & "'));"

Me.CodeSupervisor.Requery

I can only imagine that the call to requery is in the wrong spot ,
or the SQL in the row source is incorrect in some way.
If the above doesn't work then you could put the sql into a new query and provide the username manually and then see if you gt any rows...

Hth
Chris
 
Ok thanks I will try this after lunchand willlet you know.....

Thanks
 

Users who are viewing this thread

Back
Top Bottom