Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Date to Text Field 1

Status
Not open for further replies.

Tezdread

Technical User
Oct 23, 2000
468
GB
Hi,

I have a database that someone created to strip information from a file and output the remaining contents to another file. It uses VB to do this and I don't know to much about how.

What I have to do is input the name of the file each day and run hit the process button and access will do the rest.

So I have a text feild with this info

C:\Temp\Files to strip\ddmm.lwl

And I just change the ddmm.lwl to 3007.lwl for each day

I have added a new field on the form to display the current date in the same format "DDMM" and I was hoping to capture this in the other text field so I don't have to manually type in the DDMM each time.

Can anyone advise how this can be done?

Also, although the date field shows it as 3007, when I click in this box to select the text it changes back to the normal date 30/07/2004 so how do I stop this so I can quickly copy the date?



Tezdread
"With every solution comes a new problem"
 
try this:
set the default value of your text field to "C:\Temp\Files to strip\" & format(now(),"ddmm") & ".lwl"

hope it helps!

- RoppeTech
 
you're a star mate that works a treat. I started going down the macro route to pull in nfo from a text file that was created at the end of a batch script but it was starting to get messy...your way is clean and effective, thanks again...

Tezdread
"With every solution comes a new problem"
 
Hi again,

I've tried changing this to yesterday's date with various variations of the above using -1 but wasn't able to get it working.

How can I change this "C:\Temp\Files to Strip\" & Format(Now(),"ddmm") & ".lwl" so that it gets a file with yesterday's date?

Tezdread
"With every solution comes a new problem"
 
Have you tried to change this:
"C:\Temp\Files to Strip\" & Format(Now(),"ddmm") & ".lwl"
By this ?
"C:\Temp\Files to Strip\" & Format(Now()-1,"ddmm") & ".lwl"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
oh boy!

I did try that PHV as it was the logical thing to do but when I saved the form it through up an error message. I have since found that this error message was due to the file not being found and this was because I had left the date of the file to today's date! Doh.

Changed the date to yesterday's and it worked a treat.

Thanks PH

Tezdread
"With every solution comes a new problem"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top