prompt for function arguments?

I have a macro that calls a function with 2 arguments:
  Import (file path, state)

This function is importing excel files into an access database.  I
have to import a file for all 50 states.  Is there a way to set
something up that when the code is run, it will prompt for the file
path and state?

Thanks in advance for any help.
2/25/2008 6:35:38 PM
access 16762 articles. 3 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 22

You can base your path and state off unbound fields on a form so that those 
fields would need to be populated before running the code.  

If the paths stay the same for each state, it sounds though like you might 
want to make a table to store the path and state and then have the code loop 
through those records which would eliminate the data entry each time.

Hope this helps,

"" wrote:

> I have a macro that calls a function with 2 arguments:
>   Import (file path, state)
> This function is importing excel files into an access database.  I
> have to import a file for all 50 states.  Is there a way to set
> something up that when the code is run, it will prompt for the file
> path and state?
> Thanks in advance for any help.
2/25/2008 7:03:02 PM

Similar Artilces:

What formula/function can I use?
I'm creating a spreadsheet for a client and I'm not sure what formula/function I need to do this: I created a table with over 500 available values. I then created (on a separate sheet) a form to input the customers information. 4 pieces of the customer's information need to be used to figure out the correct price - Age, Tobacco or No, Male or Female, and amount of coverage. I need to be able to reference the right cell in my table according to how the 4 above criteria are met, and plug that value back on to my customer information page to show the customer their cost for c...

"Advanced Find" Doesn't Function
I just updated Outlook 2003 to 2007 a few weeks ago. I created "Advanced Find" menu on the tool bar but it's never functioned in Outlook 2007. Even though I put the right e-mail address or subject, it always says "There are no items to show in this view" in the box at the bottom. When I don't put any e-mail address or subject, it shows old e-mails from 2001 and 2002 but no newer e-mails. Could you please advise what I did wrong or what I didn't do? ...

Use cell_ref in place of an item in get pivot data function
I want to use the getpivotdata function to get data based on a cell reference in excel 2007. My pivot table is from an analysis cube. The getpivotdata function that is auto generated from clicking on the data I want is =GETPIVOTDATA("[Measures].[Order Quantity]",$B$5,"[Order Date Dim].[Year Number]","[Order Date Dim].[Year Number].&[2010]","[Order Date Dim].[Week Number Of Year]","[Order Date Dim].[Week Number Of Year].&[17]","[Product].[SKU]","[Product].[SKU].&[2]") I want to change the SKU th...

Bug in Excel's (not VBA's) MOD function
The value 12,345,678,000 is too large to store as a long integer but well within the range of integers that a double precision floating point real can store. Excel's worksheet MOD function seems to be able to work with reals, e.g., MOD(2.25,1/3) returns 0.25 and MOD(2.5,1/3) returns 0.166666666666667. However, there seems to be a glitch in it when it comes to large integer values divided by small integer values. For instance, MOD(12345678000,64) returns #NUM! even though the equivalent (per online help) expression 12345678000-64*INT(12345678000/64) returns 48 as expected. Clearly Excel...

Workbook with big array functions slow to open first time in 2003
I have a workbook created in Excel 2000 that I am beginning to use in 2003. The first time I opened the book it took 2 hours, using 100% CPU. Once open I saved to a new file and it now opens ok. I determined the slow opening was caused by a group of array functions that work on a table with 15,000 rows: Sheet1 QueryTable results: 15,000 rows with about 15 columns of data returned, then another 15 columns of simple calculations done on each row. Sheet2 40 cells containing array functions across the querytable in sheet1. Array functions are like {=sum(if(range1='w',if(range2=...

Update tab function
I have the list of tasks in one sheet (All) but I would like to have the list of the ones I mark as "yes" in column F in sheet1 in tab named "recent" Hi Try: =IF(ROW($A2)<=COUNTIF(All!$F:$F,"?*"),INDEX(All!A:A,SMALL(IF(All!$F$1:$F$100<>"",ROW($A$1:$A$100)),ROW($A2))),"") -- it is the array formula - press:Ctrl+Shift+Enter-- Eva Click yes if I helped "Ivone" wrote: > I have the list of tasks in one sheet (All) but I would like to have the list > of the ones I mark as "yes" in column F in shee...

Error with NETWORK DAYS function
Im trying to use an old spreadsheet that I have not used for a few months. But when I go back to try and update the data, I am getting the #NAME? error in the result cell. I have just tried to update an existing time by just 1 hour and it loses the result. The sum that is running is: =((NETWORKDAYS(D10,F10,K9:L10)-1)*10)+((G10 -E10)*24) we work a 10 day, monday - friday and are looking to calculate the difference in hours between 2 dates and times. If anyone can assist here I will be most grateful. Not to worry people, I have sovled it myself. I had upgraded Excel since I last used ...

hi, I have a real problem - that is getting to me, ok here goes sheet 1 lists transactions by departments on sheet 2 I would like to be able to add up the transactions for each dept. The problem is that the dept is column D but the amount is Column I any ideas ? David A Pivot Table is what you want. You can use the data on sheet1 and put the results on sheet2 If you are not familiar with Pivot Tables, see: -- Gary's Student "David Cleland" wrote: > hi, > > I have a real problem - that is getting to me,...

Function to return a picture?
Does anyone know if there is a way to get a function such as VLOOKUP to return a picture file instead of text or a number? I am using VLOOKUP to return text (a name) from a seperate table, dependent on a value that is inputted by the user - but I also want a vlookup function to return the correct logo that goes with each name that is returned. As far as I can tell vlookup just returns the contents of a cell (as specified by the column index number argument), but I can't figure out how to associate an image with a cell so that it is "embedded" in the table and can then be returne...

Function = get selected cell data
Hi all - I’m looking for a way to have data copy/load from one cell to another via selected cells. For example, I select cell a1; the data within in cell a1 is then copied/loaded into cell b1. So, I’m looking to add a formula to cell b1 that retrieves data from whichever cell is selected within the spreadsheet. Is this possible? Thanks Hi not possible with formulas. This would require vBA "Mike G - D.C." wrote: > Hi all - > I’m looking for a way to have data copy/load from one cell to another via > selected cells. For example, I select cell a1; the data within in ce...

Displaying a function result in capital letters
I am using the following fuction to convert numbers to words, but I nee all text display in capital letter. How can I do this? Function ConvertCurrencyToEnglish Dim Temp Dim Dollars, Cents Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' Convert MyNumber to a string, trimming extra spaces. MyNumber = Trim(Str(MyNumber)) ' Find decimal place. DecimalPlace = InStr(MyNumber, ".") ' If we find decimal place... If DecimalPlace > 0 Th...

"IF" "OR" function?
I would like to know how to write a formula that will look in two different cells and return an answer if there is a number in either. Here is my example. I would like the formula to look in cell A2 and if there is any number, return the word "Car" in cell A1 or if there is a number in cell A3 return the word "Boat" I would also like to have A1 blank if there is nothing in either A2 or A3. Is this possible? TIA You didn't specify what should happen if there are numbers in both A2 and A3, so I'll assume only "Car" should be returned: A1: ...

help functions
begin 666 help.xls MT,\1X*&Q&N$`````````````````````/@`#`/[_"0`&```````````````! M````&P``````````$ ``_O___P````#^____`````!H```#_____________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ M____________________________________________________________ M__________________________________________________...

Memory leak in GetInput() function of MSComm in Visual C++
Please help!!! Has anyone noticed that there is a memory leak in GetInput () function of MSComm? Consider the following code (assume that connection already existed and is working fine): COleVariant ovData; for (int i=0; i<500000; i++) { ovData = m_mcComm1.GetInput(); } I noticed that everytime when I executed the above code, my PC's memory usage will increase about 10 MB (I got the memory usage information from Windows Task Manager). So, after several round of testing, I decided to add a new line of code after GetInput() to free the memory occupied: COleVariant ovData; for (...

'Browse' function in IIS for OWA
Win2k3 Server, Exch2k3 Enterprise When I'm in IIS Manager, if I right click on the Exchange site and choose Browse, I get prompted for credentials, but no credentials that I try is accepted. After the 3rd attempt, I get "Error: Access Denied". Am I supposed to be able to do this? If so, any ideas as to why I may not be able to? Thank you! You're supposed to be able to do it. I can. I am guessing that this is a authentication issue which should be configurable under Properties > Directory Security > Authentication What do you have on this page? ...

Same error
I had this problem on a different laptop two weeks ago. No one came up with a solution. I bought a new laptop yesterday. Now that I have installed software, I get the same problem. OS: Windows XP Media Center Edition. HP DV9000 (purchased yesterday) Office Professional 2003. Laptop came with Office 2003 Standard Trial. Uninstalled and cleaned out MS Office Directory in Program Files. Install Fresh Office Pro 2003. Install all service packs and updates. Launch Outlook. Set up email accounts. 3 HTTP, 4 POP accounts. Send/Receive Button Quit working at this point. Unable to when in Add/Chan...

Outlook not prompting for profile
I have a W2000 OS w/ Outlook 2000 and 2 profiles. I have checked the "prompt for a profile to be used" checked under Tools, Options, Mail Services. It only prompts upon a reboot/startup. Shouldn't you be able to exit Outlook and then go back in and it prompt? I get the same problem at home. Sometimes it prompts me, and sometimes it doesn't. I wait several minutes after closing it before trying to open with a new profile. I'm curious to see what responses you get. >-----Original Message----- >I have a W2000 OS w/ Outlook 2000 and 2 profiles. I have >...

Nested IF and VLOOKUP functions
I'm using the VLOOKUP function to return an exact value or #N/A, if no value is found. I am trying to use the IF function to then convert the error value of #N/A to a zero (0) where #N/A exists or just insert the appropriate number using VLOOKUP. I'm hoping that someone can help me identify where I'm going wrong. I am not experienced using Excel functions but have read up on the nesting, IF and VLOOKUP functions via HELP. I'm using Excel 2000. Here's what I have so far: =IF(VLOOKUP(Sheet1!A21,'Docs'!$A$4:$B$93,2,FALSE)="#N/A","0",VLOOKUP(She...

Word VBA FilePrint Function
i want to check printing properties of word with fileprint function however, this function work in some different versions or different languages of word or does not work in some versions is there anyone whoo meet this problem or anyone who solve this before? See response in the programming newsgroup. Please do not post the same question separately to multiple newsgroups. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via

how ,we can access function in c,by using thread in VC++
hi How ,we can use thread in VC++ so that we can access any function in c. Arbind I'm not sure this question is clear. Can you give more info? "Arbind" <> wrote in message news:%23xHeb5PgDHA.908@tk2msftngp13.phx.gbl... > hi > > How ,we can use thread in VC++ so that we can access any function in c. > > Arbind > > You can use any thread in VC++/MFC to call any function, and that function can certainly be written in c. However, you must make sure that either all of the behavior of the function is completely t...

Invalid procedure call or argument
I am running an MS Access 2003 application managing a clinical practice with similar front end databases containing the code on the PC of a clinician and that of his secretary and the backend on a server to which both are linked. One of the functions is to generate letters in Word from clinics on a specified day. This procedure has worked without any problems for a year or so and continues to work on the clinician's PC. However, when the secretary activates the procedure it gets to a certain point before hanging with the error message above. The procedure is a long one but the bloc...

fix insert row functionality in frx to actually work
When inserting rows in the row format in frx, the software will delete the rows at the bottom of the row layout. example: Create a row format with 100 rows. Insert a row between row 50 and row 51. Now scroll to the bottom of the row layout. You will see that the last row has been deleted. Not a big deal if you insert one row. But if you insert several rows you will be inadvertantly destroying the report. The concept of inserting is to ADD rows. Not delete rows. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To v...

excel spreadsheet function
Hi all, I have run across one of my project and could not figure this out. This is mathematically correct, totally, but excel could not give me the desired answer: (-3)^(-2/3) returns #NUM!, but ((-3)^(-2))^(1/3) is ok. This leads to other problems also if you have time to change the base for the power function (negative and possitive) I am using Microsoft XP Professional. Thanks, Lmn. Hi Nguyen, your problem is not from excel but in your mathematic... You are asking excel to give you imaginary number... In your exemple, try to do your (result ^(-1/2))^3. (-3^[(-2)*(1/3)*(3)*(-1/2)=1] You...

"ByRef argument type mismatch" error
I get the above stated compile error when I run the following code: Dim myfile as String myfile = "Book1.xlsm" If Module1.IsWbOpen (myfile) Then ' Do stuff End If ------------------[ IsWbOpen() is in Module1]-------------------- Public Function IsWbOpen(WbName As String) As Boolean For Each wb In Application.Workbooks If wb.Name = WbName Then IsWbOpen = True Exit For End If Next End Function -------------------------------------------------------------------- Does anybody know what the heck is wrong here??? ...

MSWORD search function
How do I search for a word within a document that resides in a particular folder? When I use teh "Search" function the menu only goes as far as "my documents" and a range choice of file age or size, but not a subfolder. Was able to do so in WORD 2000 in w98, butnot in XP. How can I accomplish a word search in WORD 2000 on XP within a particular subfolder? ...