Thanks your secondone worked...i just had to change my data type from Memo to text with 255 characters.
The first one returned the same error as I had before.
Thanks alot.
Everytime I run the following code:
SELECT (All_Urls.[Computer Name]), (-1 * (All_Urls.[URL Address] LIKE '*att*') * Sum (All_Urls.[SumOfTotal Time])) AS [SumOfSumOfTotal Time]
FROM [All_Urls]
GROUP BY (All_Urls.[Computer Name]);
I recieve an error stating:
You tried to execute a query that...
Everytime I run the following code:
SELECT (All_Urls.[Computer Name]), (-1 * (All_Urls.[URL Address] LIKE '*att*') * Sum (All_Urls.[SumOfTotal Time])) AS [SumOfSumOfTotal Time]
FROM [All_Urls]
GROUP BY (All_Urls.[Computer Name]);
I recieve an error stating:
You tried to execute a query that...
I have this in a module called import:
Public Function Import_Data_Enter()
Dim strFileName As String ' you could make this global if need be
dlgCommon.ShowOpen
strFileName = dlgCommon.FileName
If strFileName = "" Then End
DoCmd.TransferText acImportDelim, "import"...
Just to let everyone know, I figured it out...
If you recieve the error that I did, you need:
DoCmd.TransferText acImportDelim, "import", "Activity_File", strFileName
instead of this:
DoCmd.TransferText acImportDelim, "import", "Activity_File"...
I did what you said:
1. Rename Activity_File to Old_Activity_File
2. Create a new table called Activity_File from using imported data. Also make a import specification called import.
3. Delete new table and rename old table.
Here is my new code:
DoCmd.TransferText acImportDelim, import...
Your answer makes alot of sense, just a quick question for you:
I have the names of the database exactly what I need...But for being easy lets just use F1, F2, etc...
How would I program it so that I could import. I really dont want to change the program that is exporting the data...That...
Everytime I run this code,
DoCmd.TransferText acImportDelim, , "Activity_File",
strFileName, False
I receive the followin error:
Run-Time Error '3066':
Query must have at least one destination field.
The problem that I cannt figure out is that Activity_File is a table not a...
The error I recieve is:
Run-time error 3066
Query must have at least one destination field.
BTW...I don't have a query named Activity_File just a table.
The contents of strFileName is:
C:\Program Files\mydirectory\export\activity\myfile.txt
myfile.txt is the file I wish to import...
It is reading it in correctly.
Thanks for everything
Just so that everyone can see I am trying here is my code:
Dim strFileName As String ' you could make this global if need be
dlgCommon.ShowOpen
strFileName = dlgCommon.FileName
DoCmd.TransferText acImportDelim, , "Activity_File", strFileName
The DoCmd.TransferText is suppose to...
First of all I dont think you are copping out...I believe in reading/doing research before asking also.
But, I guess I do not truly understand the TransferText method. I tried the TransferText but I had to specify an exact name. I tried to call the strFileName but it said that i must use an...
I wanted to thank both of you for your responses...They helped out a great deal...I now have the open dialog box, but how do I call the import function, so I can import the file that I can now select?
I need to import the file that is selected into table1...
Thanks,
Shane
Like the title says i need to programmatically import a text file into access. I found that I can do this from File->Get External Data->Import. I also found the macro code for transfer text. Transfer text would work except that my file name that I import from changes. For instance the name...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.