When you say "execute", I assume you mean an "action" query - update, append, delete, make table. Let's say the name of the query is in the bound column of the combo box, and the name of the combo box is cmbQuerySelect. You could execute the query in code behind a command button on the form like this:
Dim db As DAO.Database Set db = DBEngine(0)(0) db.Execute Me.cmbQuerySelect, dbFailOnError John Viescas, author "Building Microsoft Access Applications" "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of DHANANJAY Sent: Thursday, November 24, 2005 2:32 AM To: [email protected] Subject: [ms_access] Execute different SQL query's base on combobox field Hi Access Group, I am just started learning VBA code. I am doing one program where I have to execute different SQL queryfs base on combobox field selection. If any one knows how to do it then please let me know example. Regards, Dhananjay Awachat ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
