Using Filtered Combo boxes to open an external PDF

jjake

Registered User.
Local time
Yesterday, 23:57
Joined
Oct 8, 2015
Messages
291
Hi,

I have numerous folders on my shared drive that contain manuals and spec sheets for pumps.

I have a form with 3 combo boxes that draw values from 3 different tables.

tblPumpManualTypes
tblPumpManufacturers
tblPumpModels

I have setup a query and requery so that when i pick a pump manufacturer [cboManufacturer], It only shows the pump models in [cboModels]. Which all works great.

I then have a submit button under them so that when i pick my manual type, my manufacturer and my model and click submit it will open up the corresponding PDF saved on my S: Drive (Run a path file per pump model)

What would be the best approach here? Or should i just set them as attachments?
 
I personally don't use the attachment data type. I store a path to the file. If your path/file name can be derived from the selected info, you can build a string and use FollowHyperlink or Shell to open the file.
 
Right, i have had success doing this with a simple on click command open so and so file.

My trouble is being able to decipher which pdf to open when each value from 3 separate combo boxes is entered.
 
Well, I have zero knowledge of what your combos contain or what your paths are. In general, if the combo contained the file name, something like

"S:\" & Me.ComboName & ".pdf"
 
Well, I have zero knowledge of what your combos contain or what your paths are. In general, if the combo contained the file name, something like

"S:\" & Me.ComboName & ".pdf"

Ok let me give you an example.

Pump manual types are, Owners manual, Parts manual, Spec Manual.

Pump manufacturer, 1, 2, 3

Pump model, 1a, 1b, 2a, 2b, 3a, 3b (the number represents the manufacturer of the pump)

If I select owners manual for pump 1, and model 1a, it would open pdf1

If I select parts manual for the same manufacturer and model it would open pdf 2

If I selected a different model it would open pdf3

and so on, every different combination would have a different path.
 
I don't understand the relationship between the selections made and the pdf to be opened. I expected that if I chose model PD10P there would be a pdf by that name. From post 5, that doesn't seem to be the case.
 
I don't understand the relationship between the selections made and the pdf to be opened. I expected that if I chose model PD10P there would be a pdf by that name. From post 5, that doesn't seem to be the case.

If you chose model PD10P it would open a different PDF depending on whether you selected owners, parts or spec manuals. They are all different.
 
So are there just 3 pdf's and you want to open the one related to the type chosen?
 
Yes, but each model could have 3 manuals each. (different or some the same)

I guess I would need a line of code for each variation?

if type = 1 and model = 1 open a1
if type = 2 and model = 1 open a2
if type = 1 and model = 2 open b1
 
I guess so, if there's no correlation between the text of the selection and the text of the file name. Or add a field to the appropriate table and store a PDF name there.
 
So I got to thinking about this a bit more, and I think for the future of my database it may be better to store them as attachments. It will be easier for someone else to add and edit without me having to add more code for every manual that may get added later.

I have attached an example of the pump manuals on pump NDP 40 and NDP 80.

Every manual has a specific ending to the file name for example,

Owners Manual = OM
Parts Manual = PM
Spec Manual = SM

So depending on the pump model it could be NDP 80 OM or NDP 40 PM.

So something like if PumpManualType = 1 and PumpModel = 2 open pumpmanualattachment where pumpmanualtype = to last 2 letters? or something.

Or maybe should I create an attachment field for each manual type in the model table?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom