473,378 Members | 1,394 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,378 software developers and data experts.

Save using Current Date and Current user profile

MattFitzgerald
Hi hope some one can help I have 2 questions:-

Question 1) When saving a file in access to excel how do I specify current date

Question2) When saving a file in access to excel how do I specify current user profile

To be more specific I have a Macro in MS Access and I have selected Action "Output to"

The Output file is currently set to:-

C:\Documents and Settings\Fitzgem4\Desktop\CadburyData_Date

I want to replace Fitzgem4 with Current User and Date with Todays Date

The output format is set to Excel

I am intending to attach the Macro to a button any ideas how I can do this?

Best Regards

Matt Fitzgerald
Feb 1 '08 #1
2 3096
sierra7
446 Expert 256MB
Hi Matt
I don't understand exactly what you mean by user profile. If you mean Windows Username then the attached utility will find it and put it into a string called "Username", that you can use.

If you want something out of the Access workgroup file then someone else will have to help.

To get the date just setup a string, set it to current date then concatonate with the Username string from the attached module. eg
Expand|Select|Wrap|Line Numbers
  1.  Dim strDate as String 
  2. Dim strFileName as String
  3.  
  4. strDate = Format(Date,"ddmmmyy") 'or whatever is your prefered format
  5.  
  6. strFileName = Username & "_" & strDate
  7.  
  8. 'Output file = C:\Documents and Settings\Fitzgem4\Desktop\strFileName 
  9.  
I would not use a macro, just write the code into the On_Click event procedure of the button.

Hope this helps

S7
Attached Files
File Type: zip Username2000.zip (18.4 KB, 183 views)
Feb 1 '08 #2
Thank you I did mean username and I now have it working
Feb 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Nikhil Tayal | last post by:
Is there a way to write a file on the client machine from an aspx page? I've a custom query page and need to store the search criteria specified in an XML file on the user machine from my web page...
0
by: Rodusa | last post by:
I am trying to replace cookies with the new "Asp.net 2.0 profiles" in my shopping cart application, but I am having trouble to access profile properties using HttpContext.Current.Profile. I can...
0
by: dba123 | last post by:
I need to "tie together the cookie with the domain" by referencing the information from my web.config below in my login's codebhind. I don't understand how. I need to also save that after...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
1
by: VictorG | last post by:
Hello, The below C# code works fine in obtaining the windows user's account SID when the user is local to the machine. It throws a "Not Found" exception when trying top obtain the SID for a...
0
Boxcar74
by: Boxcar74 | last post by:
Hi Everybody!!! I have an Issue. I have an Excel file that queries an Access db. I’m trying to have it so I don’t have to keep updating it manually everyday and save it to a network drive...
2
by: Nick | last post by:
Hi there, I have a web site, with a web service in folder within the website. Everything works as I would expect it to. I have just added some functionality to the web service that accesses a...
0
by: shapper | last post by:
Hi, I want to access the profile from the current user. Shouldn't it be as simple as: Profile.PostalCode = "1000"; However, when I write Profile on my C# code it is not recognized. Do I...
0
by: TimVtoo | last post by:
Hi. I want administrators in my intranet application to be able to create new users and save Profile information (such as FirstName, LastName etc.) without having to login as that user. I can save...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.