Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Back to Access Forum    Comments List
Learning Upload Images   Link   Email  
Joseph Messina 
Hi Richard:\

I wantt o say to you that i'm so proud of myself.  The whole weekend I been working on my contact database rebuikld my contact form like you have in the ABCD database.  I create the subforms with address, phone email etc.  I know Ray White helped me seting up the tabs for me like in the ABCD database.  I accidently my database and thank god I had a backup but, it was my original database that I showed you that you looked at i sent you a while ago and I just  redid the form with the form with all the fields and the setup like in the ABCD database.  I was following your videos.  I got it back to way I want my database.  Thank god for learning the lessons I get every week from you and also watching the techhelp videos and also watching the ABCD videoas

Joseph Messina 

Joseph Messina 
Hi Richard:

Please see screenshot.  I built this all by my self and following with the ABCD database too.  I'm so very proud of myself.  I lov the way i did my form and also with the tabs like in the ABCD database..  I have question./  On my documents tab.  I'm not sure sure if you saw the last screen shot I posted few days ago I want to know if there is a way I can just have the file name and not have the file path so the subform doesn't take up ther whole mane form if I need to ad more fields to the main form?
Joseph Messina 

Adam Schwanz 
You can set the visible to no or make it smaller and add another field to your table for document name.
Joseph Messina 
Ok thank u Adam.  I will try making the field visable.  I was thinking about that.  That good idea.  Will mske the field visable
Joseph Messina 
Hi Adam:

If I make the field vissble i won't be able to double click on  the file to open it?
Joseph Messina 
Hi Adam:

I think I will just lesve it the way I have it, cause I need the file name there to double click on it to open it when need to open a file.  I hsve the file set to double xlick on it to open.  Thank u for letting me know I can do if i want yo make the field visable or make tge field small and add another field to my tsble for document name.  I was just curious if there was a way I can just see the file name without the file path.  Really appreciate you letting me know what I can do.  I will definitely continue to learn with the lessons which I am.  So proud of mysrlf I built my form in my vontact database the way I want it even with the tabs like in the ABCD database.  When I was rebuilding the form the way I want it with the tabs I was following a long with the ABCD vidro.
Adam Schwanz 
You can just make the file name fields on click event fire the longer file paths on click event. Then you can still hide the path.

Private Sub FileFieldName_Click()
    FilePathFieldName_Click
End Sub
Joseph Messina 
Hi Adam:

I will try that.   I see you

Private FileFieldName_Click()
   FilePathFieldName_Click. When I put FilePath do u mean with FieldName I put the actual name of the fieldName?  O just want yo make sure I"m understanding you right?
Joseph Messina 
I got it Adam.  It worked.  Thank u so much
Joseph Messina 
I really appreciate you helping me pointing me in the direction how I was able to handle to have thr field without the filepath.
Adam Schwanz 
No problem glad you got it figured out.
Joseph Messina 
Hi Adam:

Sorry to bother you.  I know i replied to you and said that i was able to get it to work.  I went back into my contact database and I
'm getting an erro please see screenshot.  I thouhgt I got it to work
Joseph Messina 

Adam Schwanz 
So what does it highlight in your code when you push OK there?

What you need to do is go to your field with your file path and go to the click or dbl click event, whatever you have your event assigned to. It will look like

Private Sub SomeName_Click or SomeName_DblClick depending on if it's under click or dbl click, then your code for the event.

That SomeName_Click or SomeName_DblClick is what you want to put in on click or on dbl click event in your field that shows the files field name.

It should end up looking something like

Private Sub WhateverYourFilePathFieldNameIs_Click
SomeName_Click
End Sub
Joseph Messina 
Hi Ada:

    This is Highlighted when afte4r i click okay on the message

Private Sub CUsersJEM04DropboxDocumentName_Click()
Adam Schwanz 
That's quite the field name... And that is the name of your field?
And It's setup like this?

Private Sub CUsersJEM04DropboxDocumentName_Click()
SomeName_Click      <- the name of your file path field's event
End Sub     <- Make sure you have end sub

Also make sure the event is linked to the field. When you go to the properties -> events of the field, it shows Event Procedure on the click event?
Adam Schwanz 
It should look like this with your field names, works for me

Private Sub Command13_Click()
    SerialNumber_Click
End Sub

Private Sub SerialNumber_Click()
    DoCmd.OpenForm "TransmissionF", , , "SerialNumber=" & SerialNumber
End Sub
Joseph Messina 
Hi Adam:

The name of my field name is documentname
Joseph Messina 
Hi Adam:

This is the field Name:  DocumentName

FilePath:  C:\Users\JEM04\Dropbox
Adam Schwanz 
Look at my exAmple above that i tested. Thats how you make it. Whats the name of your field that has the file path in it?
Joseph Messina 
Hi Adam:

The name of the field that has the file path is called documentname
Joseph Messina 
The name of the file path
C:\jem04\dropbox
Adam Schwanz 
Ok so if the field that has the file path stored in it is DocumentName What is the name of the second field you made to only show the documents name?
Joseph Messina 
Hi Adam:

    I have 2 fields.  I forgot to put the 2nd field in the table and the form.  Ok Here it is

Field with the file path is named filepath
Field to only show document name is named DocumentName
Adam Schwanz 
Well that's part of your problem. Maybe I'm making assumptions of how you have it setup too. Are you storing the attachments IN THE DATABASE? Or is it just a file path to the file location on your computer? And then you open that with code?

So if it's an ON CLICK event on both fields, this is what you need, Change Click to DblClick if it's an ON DOUBLE CLICK.

Private Sub DocumentName_Click()
    FilePath_Click
End Sub

Private Sub FilePath_Click()
    Current code to open the file that you have
End Sub
Adam Schwanz 
You also don't necessarily need a field in your table, I just found Rick has this too. You could just use an unbound field and use this to get the file name.

https://599cd.com/blog/display-article.asp?ID=1341

But worry about that later, just try to get it to work first.
Joseph Messina 
II don't have attachments in my database.  I made a sperate table and form to have multple documents, pictures etc for a contact.  in the table and form I have field for filepath, description and have a combo box for document typwe and just added another field for document name
Joseph Messina 
HI Adam:

Here is how I have it in the code

Private Sub DocumentName_Click()
    FilePath_Click    
End Sub


Private Sub FilePath_Click()
    C:\Users\JEM04\Dropbox        
End Sub

That is the filepath above for my folder
Joseph Messina 
Hi Adam:

Not sure if you saw my last Comment.  I knw i'm still trying to get this to wok just to show the document name of the file not to show the file path in just double click on the document name in the oducments tab in my database.  I just want to show you what i did think going to have it like this.  I know working for you what i wan to do.  I put my document subform like this until i figure how why not working for me./
Joseph Messina 

Adam Schwanz 
OK, we have a miscommunication somewhere. This makes no sense to me, isn't it in an error state(red) to even have it like this?

Private Sub FilePath_Click()
    C:\Users\JEM04\Dropbox        
End Sub

Does the form open the document when you click on the file path or is it just a text string field to tell you where it is?
Joseph Messina 
Hi Adam:

I have the documents form as a subform in my main form on a tsb like the tsbs in the ABCD database.  I double click on a document thst i hsve under a contact.  Opens fine.  I just want the file name to show without the file psth.  Thst what I'm trying yo do
Joseph Messina 
HI Adam:

   Please see screen shotn way I have my documentssubform set up
Joseph Messina 

Adam Schwanz 
All good, solved in e-mail.
Joseph Messina 
Hi Adam:

Thank you again so much.  Really appreciate.  Now I understand what happen.  I looked at it and really like that I can just click on the document name and opens.  I hid the file path field.
Joseph Messina 
Hi Adam:

Not sure if I said this to you in the last post.  I was looking at the code in the VBA and now i see what you meant I already had the code for the file path and just had to make a nother field and name that to click on the document name.  I know what to do now.  I understand.  If i need help with anything else will let you know.
Joseph Messina 
Hi Adam:

My contact form working all good now with the documents thank you again..  I just have question about field with documwent name.  I know it has the on click event to open the file.  When I go to click on the browse button to add a file the file goes into the filepath field.  I want to know how I can have the document name add when I go to add a file.

For example

Important phone Numbers.xlsx

Adam Schwanz 
You're going to need to use something like this to take the file name off the path if you want it set automatically.

https://599cd.com/blog/display-article.asp?ID=1341
Joseph Messina 
Ok thank you Adam
Joseph Messina 
Hi Adam:

I saw the link you gave me.  I will do that.  Just curoius is there video so I can watch the video?
Joseph Messina 
Hi Adam I was trying to put the code to return the file name from file path.  I clicked on my button i created and not sure if to put the code above the code i hzve for button or on the file path field.   I'm trying everything.  I just don't want to put it in the wrong place
Joseph Messina 
Hi Adam:

   I remembered to backup my dstabase with the changes when trying yo do the code you gsve to me rerurn file name frok file psth
Adam Schwanz 
It's probably easier to put it in the button. Put it at the bottom of the code that picks the file.
Joseph Messina 
HI Adam:

I put that code in the button.  Please see screen shotas.  I went to do  a test and the file name doesn't show and when I have the path fiel showing and click browse the whole path shows with file name.  I put the code where you told me.
Joseph Messina 

Joseph Messina 

Joseph Messina 

Alex Hedley 
Command31 Joseph! Disappointed :p
Joseph Messina 
I forgot to name the button when I created it
Joseph Messina 
Hi Alex:

   Sorry about that will make you happy now i fixed it.  I never namedd the button when i created the button to pick a file.  please see screen shot will make you happy fixed the name of the button in the code
Joseph Messina 

Joseph Messina 
Hi Alex:

I want to know is there a video how to have just file name without the file path.  Adam sent me the code how to do.  I'm trying to figure out have it in my button where i pick file  when the file gets uploaded.  When i pick a file the fuilepath and filename shows.  i just ant the file name to show not the path.  I tried the code in the button I have and if you see last screen I posted of documents and show filepath and filename. just doesn't show the file name.  That what i want juast dfile name.  I know Adam was trying to direct me how to do it.
Adam Schwanz 
Honestly, your kind of trying to learn to run before you can crawl. You're dealing with stuff that's not supposed to be messed with until you have at least basic understanding of VBA in the developer classes. When you understand what the code is doing it's a lot easier to understand and put it together right. You've made the function, but your not calling it anywhere to use it. I'd be happy to help you with paid support, you have my email. But I won't be able to get to it until tomorrow probably.
Joseph Messina 
Hi Alex:

I understand what you are saying.  I'm not trying to run go fast what I want to do in my database.  I know I'm still learning with the courses and still on expert level.  I promise after you help me with this.  I will cpntinue to learn with the courses and not go fast and run.  I truly underdtand have to learn expert and advanced before i get to developer
Joseph Messina 
hi Adam:

Thank you again so very much.  I really appreciate your help.  It is all working good.  If I need anything else will let you know.  I will continue to learn the Access courses from Richard.  I love Access.  My favorite database program

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

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 8:06:55 AM. PLT: 0s