Hyperlink .pdf from P/N entered in a form:

JWT

Registered User.
Local time
Today, 20:53
Joined
Dec 10, 2001
Messages
31
I have looked over most of the replies given to similar questions and not able to run this my way.
The report is setup that when you enter a P/N if it matches an existing number it will retrieve and fill in the form to add/edit, if not it lets you enter your new P/N.
I want to have a button that will take the [P/N]& .pdf then go to the folder find the matching .pdf and open it or if no match msgbox will appear.
If you can show me in with a zip file I view your set up, Thank for all the help JWT
 
Last edited:
Have Sample

Hello again,
Well I’m not getting far with this one. I feel my wording is off in my macros – The save bar in the “Entry-1” form is not saving just one line in the table when I need to edit/add additional information – I am trying to set a bar that will pull a file set in a folder that is a .pdf file. To ID each file it will use the same “ECI Number” that is entered on this form. I‘ve had no luck to click on this bar and have this open to another window. I can hyperlink to a set path, but only one it will not accept \\PATH\[ECI Number] &”.pdf” to open file.
Here is a cut down sample database to see how I‘ve set up my form, maybe someone will show me a way to fix it or what I have set incorrectly.
Thank you, JWT
 

Attachments

Try this for the file-opening. I have changed the event procedures to VBA so that you can get an idea of how to use code in your forms. See if it works with your path names on your server - I copied and pasted the UNC path so it should be correct. Your save macro was only saving the form (ie the form) and not the record held inside it!

Get back with any queries
 

Attachments

A Big Thank You!

Fizzio

Would have never found the path for the .pdf file without your help was able set it in to my original form and work just the way I had hoped.
Did see the macro I used was set on save form not the record. If I ask how do you work this to do in this order,

On Click
1. Save Record
2. Reset Form (Clear/Blank All Text Boxes)
3. Return To First Place Again (Tab 1)
4. Beep

Here is you setting,

Private Sub Up_Date_and_Save_Data__Click()
DoCmd.RunCommand acCmdSaveRecord
End Sub

Again thanks for all the time and help. JWT
 
I never use macros - as VBA is much more flexible but I'll have a crack at it - I suggest you learn VBA from the example I gave and as many other sources as possible - the VBA forum here is an excellent source of info.

anyway
Macro (Command/(Setting)Value)
VBA equivalent

1.
(M) RunCommand / (command)Save Record
(VB) DoCmd.RunCommand accmdsaverecord

2. Not sure what you are trying to do here - If the records are bound (as your were in the example you posted) do you mean prepare a fresh sheet for a new record? or just a form used for filtering.
If you mean prepare the form for a new record
(M) GoToRecord / (Record)New
(VB)docmd.GoToRecord ,,acNewRec

3.
(M) GotoControl / (ControlName) YourControlName
(VB) me.YourControlName.Setfocus

4.
(M) Beep
(VB) DoCmd.Beep


Total VBA

Code:
Private Sub Up_Date_and_Save_Data__Click() 
DoCmd.RunCommand acCmdSaveRecord '(Not Actually Needed)
Docmd.GoToRecord ,,acNewRec
me.YourControlName.Setfocus
DoCmd.Beep
End Sub
 
THANK YOU.

Fizzio,

Thanks for the step-by-step; this is my first go at forms. This has been a big help. I have been working with reports and labeling to assist our warehouse as a learn as you go setup.
Again thank you for the time you took to work on this. JWT
 

Users who are viewing this thread

Back
Top Bottom