Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Generate a Document name
William Kennedy 
    
3 years ago
I want to generate and store a [DocFileName] field in my Form Jur_125_Journal_F and store it in Jur_125_Journal_T.  It is developed from (First Three Characters of [EventType] field concatenate with a Text character _ and the [JDate] field formatted as yymmddhh.  I will store that as a word document record using [DocFileName] as the file name.  Example: Reg_23010913.docx.

Ive been working on this for a few days and am missing something.  
William Kennedy OP  @Reply  
    
3 years ago

William Kennedy OP  @Reply  
    
3 years ago

Juan C Rivera  @Reply  
            
3 years ago
William Kennedy OP  @Reply  
    
3 years ago
Content within [EventType] is 'Regular'.
Content within [JDate] is '01/01/2023 19:00' I want to convert that to yymmddhh or '23010119'
Then I need to Concatenate the two fields together this way.
First 3 characters within EventType
The single Character '-'
The converted [Jdate] 23010119
Final date stored = Reg-23010119.  This would be used to link Database reports to other support files
Then I want to store that into the [DocFineName] form field so that it would be stored in table when form is closed.
I'm just beginning to use VBA.  I've been working on this for a few days and am missing something.  
Thanks for any help.  
William Kennedy OP  @Reply  
    
3 years ago

Kevin Robertson  @Reply  
          
3 years ago
You can do something similar to this:
Dim docName as string

docName = cboEventType.Column(1) & "-" & Format(JDate, "yymmddhh")
DocFileName = docName


Obviously make modifications to suit your needs.

See these videos for further help:
Intro to VBA
Concatenation
Format
William Kennedy OP  @Reply  
    
3 years ago
Thanks that was Great.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 10:32:45 AM. PLT: 1s