Results 1 to 6 of 6
  1. #1
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145

    Creating ID of Date and Name on Form

    Hi Forum,

    I would like to create a unique File Name based of the Date() and Name(initials). Below is an illustration of what I want to accomplish. Right now, I have the File Name in a calculated field from the table that does this for me. I hear it may pose problems later so i want to write a VBA code that does this on the form level.

    Click image for larger version. 

Name:	1.png 
Views:	11 
Size:	36.4 KB 
ID:	29337Click image for larger version. 

Name:	2.png 
Views:	11 
Size:	13.8 KB 
ID:	29338

    tblQEINames have the names with the associated initials to them.



    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    on the form , set the textbox FILENAME2 source
    =txtName & Format(Date,"yyyymmdd")

    if you want the item in the subform, make the query in the subform assemble it:
    QEIINITIALS & Format(Date,"yyyymmdd")

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    What if you have 2 with same initials on same day? You probably should ad the time in seconds also after the date. I also would avoid the dashes and make month and day 2 digits so it is all even.
    20170706013424RC (013424 is hhmmss)
    20170706021441GM

  4. #4
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145
    Quote Originally Posted by ranman256 View Post
    on the form , set the textbox FILENAME2 source
    =txtName & Format(Date,"yyyymmdd")

    if you want the item in the subform, make the query in the subform assemble it:
    QEIINITIALS & Format(Date,"yyyymmdd")
    Is this on expression builder? Should we avoid using expression builder vs. writing a VBA code for it?

  5. #5
    raychow22 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    145
    Quote Originally Posted by Bulzie View Post
    What if you have 2 with same initials on same day? You probably should ad the time in seconds also after the date. I also would avoid the dashes and make month and day 2 digits so it is all even.
    20170706013424RC (013424 is hhmmss)
    20170706021441GM
    No I don't need it to be that specific. If there were two same initials, I would create RC to RC1; however all of our guys here have different combo initials.

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    A couple of things...

    - I would suggest you do not begin the file name with a number.

    however all of our guys here have different combo initials.
    - Right now... Maybe use first, middle & last initials???

    You don't really have first and last names in the same field???

Please reply to this thread with any new information or opinions.

Similar Threads

  1. creating weekending date
    By nclemmons in forum Access
    Replies: 4
    Last Post: 05-01-2015, 09:20 AM
  2. Creating Last Run Date for Reports
    By housmand in forum Reports
    Replies: 17
    Last Post: 06-03-2014, 09:37 AM
  3. Replies: 1
    Last Post: 01-10-2013, 08:33 AM
  4. Creating a Date Range Form
    By daniejm in forum Forms
    Replies: 1
    Last Post: 12-13-2012, 08:51 AM
  5. Replies: 4
    Last Post: 01-25-2010, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums