Combo box

le888

Registered User.
Local time
Today, 08:41
Joined
Dec 10, 2003
Messages
344
Hi,

I have a form and in the form, I have a text box : Book Suject. Then I have a combo box which has all the tiltles of each suject. My problem is how can limite the choice which link to my book suject. For example:

Book Suject: Sciences
Combo Box: Physics
Maths

If my Book Suject: Languages
Combo Box: English
French

However, right now my combo box shows all the titles which is

Combo Box: Physics
Maths
English
French
Any ideas that I can fix it?

Thanks,

Le
 
Reset the Combobox's rowsource after the text field has been updated.
For example, assuming the Combobox gets it's data from a table called 'Titles', it's basic rowsource might be

"SELECT [BookTitle] FROM Titles ORDER BY [BookTitle];"

In the AfterUpdate event of the Text field you could add
Code:
Dim str_Source as String

str_Source = "SELECT [BookTitle] FROM Titles " & _
                  "WHERE [Subject] = '" & _
                  [[I]form name[/I]]![[I]text box name[/I]] & _
                  "' ORDER BY [BookTitle];""
[[I]form name[/I]]![[I]combo box name[/I]].RowSource = str_Source
[[I]form name[/I]]![[I]combo box name[/I]].Requery
 
Sorry, I don't quit understand. Here is my database.

Thanks,

Le
 

Attachments

Firstly I would say that your text box (suject) needs to be a combo box as well because if you do not put the correct spelling of the subject in there then the combo box will not work as you want it.

I have made changes to your form (and database) and have attached it to this posting.

HTH
 

Attachments

Users who are viewing this thread

Back
Top Bottom