473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Automate Running Command

The code here creates a table for every instance in the combo box on my form. what I would like to do is have it run automatically without selecting each row/record/instance and pressing the button. I would want it to just run for every instance in the list.
Dim strSQL As String
Dim strSourceSelected As String
strSourceSelected = Trim$(Me![Combo5])

strSQL = "SELECT Market.* INTO " & strSourceSelected
strSQL = strSQL & " FROM Market"
strSQL = strSQL & " WHERE Market.Field4 = [Forms]![Create_Market]![Combo5]"
DoCmd.RunSQL strSQL

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
3 1360

Chris Arenburg via AccessMonster.com wrote:
The code here creates a table for every instance in the combo box on my form. what I would like to do is have it run automatically without
selecting each row/record/instance and pressing the button. I would
want it to just run for every instance in the list.

Dim strSQL As String
Dim strSourceSelected As String
strSourceSelected = Trim$(Me![Combo5])

strSQL = "SELECT Market.* INTO " & strSourceSelected
strSQL = strSQL & " FROM Market"
strSQL = strSQL & " WHERE Market.Field4 = [Forms]![Create_Market]![Combo5]" DoCmd.RunSQL strSQL

--
Message posted via http://www.accessmonster.com

if you have the source of the combobox, why not just open a recordset
based on the combo's rowsource and then loop through it? Seems like
you're just making work for yourself doing it this way, and making
things unnecessarily complicated...

Nov 13 '05 #2
Right I a gree I am new to the VBA side of Access and I haven't had experience with Looping. I was hoping for some sample coding.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3
I am new to the VBA side of Access and especially looping I know there is an easier wasy, I was hoping for some sample code. Thanks

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Niko | last post by:
Hello, I want to retrieve the details of an SSL certificate of HTTPS websites, using openSSL, running on Windows 2003. This works fine as follows: openssl s_client www.somewebsite.com:443 >...
6
by: John Galt | last post by:
Does anyone have working code to send a fax from VBA using Outlook.Mailitem? I have tried some examples I have found and they all simply try to use the Fax number as an e-mail address. Thanks in...
5
by: James Johnson | last post by:
Dear C#dex, You can automate a POST and interrogate the resulting HTTP stream using code such as: HttpWebRequest hwreq = (HttpWebRequest)WebRequest.Create(url); hwreq.Method = "POST";...
15
by: Karl | last post by:
Hi all, I regularly use FTP to place Self Extracting Zip files on the web for remote users to update their datafiles. Works very nicely. I have automated the creation of the initial zip file (...
4
by: DarkBlue | last post by:
I am trying to write a script (python2.3) which will be used with linux konqueror to retrive 2 webpages alternatively every 2 minutes. My question is how can I send alternative args (the url) to...
1
by: Liam.M | last post by:
I currently HAVE a form...a "Summary List" it could be called...which is a contineous form...AND on this form are "Four fields" from EVERY record (each on their own line) so to seak...like a...
11
by: gert365 | last post by:
I'm working on a scirpt to be used on a windows machine and I need to automate a user's input on the command prompt. For example I'm using os.system('mycommand') to excute the commands I want. ...
3
by: D | last post by:
I would like to write a program that will automate the configuation of a firewall or router via HTTPS. So, I need to import the applicable certificate, and be able to configure the unit as if I...
3
by: aniphilip | last post by:
Hi All, I have a requirement to automate Access functionality from Excel. I need to open Access, trigger button events and close Access from Excel. I Achieved opening Access from Excel. I...
8
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a web site that automates excel. This site runs in server 2003. iis 6.0 office 2003 installed I moved this app to server 2008 iis 7.0 office 2003 installed Now when I try to automate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.