Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show new data in combo box without exiting the form

Status
Not open for further replies.
Jan 18, 2007
39
US
I have a combo box that looks at a table containing the field Class Title, which list all the classes in the table. Here is the SQL code of the row source:

SELECT DISTINCT tblTraining.[Class Title]
FROM tblTraining
ORDER BY tblTraining.[Class Title];

This works wonderful. The only problem I have is when I add a new Class Title (a new Record, containing other data as well) and want to add a second record with the same Class Title with different information I have to exit the form and go back into the form in order for the Class Title I just added to show up in my listing. Is there a way that I can add a new record (new Class Title), save the record, and have the Class Title appear in my listing without having to exit the main form?

Any help is appreciated.
Thanks,
Phil
 
How is the new Class Title added ?
In the corresponding event procedure:
Me![name of combo].RowSource = "SELECT DISTINCT [Class Title] FROM tblTraining ORDER BY 1"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How 'bout, when you save the record, [name of combo].Requery


TMTOWDI - it's not just for Perl any more
 
Reguery is a good way to refresh your combobox from his source after entering a new data into that source. No need to exit and re-open your form.
 
Thanks for the suggestions. I will give it a try and repost after I modify the database.

Thanks Again for taking the time to respond to my questions!!!!
 
Thanks Adalger!!! It worked wonderfully.

I still want to try the recommendation by PHV.

Thanks Again everyone for taking the time to reply!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top