hi,
I'm trying to use a macro to import a file that contains a certain filename. the catch is the file name will always be the current date. ex. johndoe101707.txt. i'm new to access so, you may have to simplify the code for me.
Thanks
7 1128
hi,
I'm trying to use a macro to import a file that contains a certain filename. the catch is the file name will always be the current date. ex. johndoe101707.txt. i'm new to access so, you may have to simplify the code for me.
Thanks
- "johndoe" & Right("0" & Month(Date()), 2) & Right("0" & Day(Date()), 2) & Right(Year(Date()), 2) & ".txt"
- "johndoe" & Right("0" & Month(Date()), 2) & Right("0" & Day(Date()), 2) & Right(Year(Date()), 2) & ".txt"
Thank you, I just tried running the code and it said that i cannot import a file that doesnt contain the following extensions: .txt, .csv, and etc.. i'm not sure if it has something to do with the quotation marks surrounding the txt or what. Thanks for the help so far
It's an expression so you have to put = in front of it first.
ok so far this is my code, if i'm correct i'm inputting this into the macro and the action to be performed is transfer text, correct? after that i impute the code on the line that says filename. File name is where i in put the following:
\\C\desktop\="johndoe" & Right("0" & Month(Date()), 2) & Right("0" & Day(Date()), 2) & Right(Year(Date()), 2) & ".txt"
after i insert the equal sign it says that the file must end in .txt or should i write the code in vb and if so, how? here's my code in VB - Public Sub import()
-
Dim Apel As Date
-
Dim APELLES As String
-
Dim result As String
-
-
Docmd.TransferText = "johndoe" & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & Right(Year(Date), 2) & ".txt"
-
-
End Sub
-
i get all sorts of errors ranging from object doesnt support this method to variable functions.
nothing happens here either.
Thanks a lot.
In the filename field, you put: - ="C:\desktop\johndoe" & Right("0" & Month(Date()), 2) & Right("0" & Day(Date()), 2) & Right(Year(Date()), 2)
In the filename field, you put: - ="C:\desktop\johndoe" & Right("0" & Month(Date()), 2) & Right("0" & Day(Date()), 2) & Right(Year(Date()), 2)
Thanks a lot, finally got the code working. I really appreciate it.
Not a problem, good luck.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stian Søiland |
last post by:
all examples performed with:
Python 2.3+ (#2, Aug 10 2003, 11:09:33)
on linux2
(2, 3, 0, 'final', 1)
This is a recursive import:
|
by: Vio |
last post by:
Hi,
I've been trying to embed (statically) wxPy alongside an embedded py
interpreter on a linux/gtk box.
At one point, for some reason misc.o linking reported "multiple
definitions of...
|
by: John Roth |
last post by:
I've found a case where it seems that Python is importing two copies of a
module without any reason or indication. It took me a while to verify that
this is what is occuring: I had to write a...
|
by: Steve Holden |
last post by:
This is even stranger: it makes it if I import the module a second time:
import dbimp as dbimp
import sys
if __name__ == "__main__":
dbimp.install()
#k = sys.modules.keys()
#k.sort()
#for...
|
by: mark |
last post by:
In Access 2000 and 2002, I have created an import specification to import the
fixed-width recordset below into an existing table. I am having strange
problems with the import of the date and time...
|
by: Bruce W. Roeser |
last post by:
All,
I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good
content but am confused about the difference. From the text:
...
|
by: Jon |
last post by:
It appears that (windows) python searches in the current working
directory before looking in the local site-packages directory, or that
'.' comes first in sys.path? The problem arises when I made...
|
by: Ron Adam |
last post by:
from __future__ import absolute_import
Is there a way to check if this is working? I get the same results with or
without it.
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17)
on win 32
...
|
by: W. Watson |
last post by:
Is there a single source that explains these statements?
------------------------------
from Tkinter import *
from Numeric import *
import Image
import ImageChops
import ImageTk
import time...
|
by: rsoh.woodhouse |
last post by:
Hi,
I'm trying to work out some strange (to me) behaviour that I see when
running a python script in two different ways (I've inherited some
code that needs to be maintained and integrated with...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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...
| |