I need to be able to pass a variable from a procedure on one form to anther. Basically what this does is in our database there may be part numbers like 123-456/88", when we make files in windows i have to filter out the illegal characters in order to search and open a pdf or file with the same name. I want to be able to pass that variable "File" to another forms procedure. I have found a few examples on how to this but for some reason i'm just not getting it. Any help would be greatly appreciated.
Code:
Private Sub Command53_Click()
Dim PartNumFilter
Dim PartNum
Dim PartDescFilter
Dim PartDesc
'-------------------------------------------------------
PartNumFilter = Replace([Part Number], Chr(34), "_")
PartNum = Replace(PartNumFilter, "/", "_")
PartDescFilter = Replace([Part Number], Chr(34), "_")
PartDesc = Replace(PartDescFilter, "/", "_")
'-------------------------------------------------------
If Len(Dir("\\TPIS01\engineering\drawing pdfs\drawings\" & PartNum & ".pdf")) > 0 Then ' Check to see if file exists
File = "\\TPIS01\engineering\drawing pdfs\drawings\" & PartNum & ".pdf"
Else
File = "\\TPIS01\engineering\drawing pdfs\drawings\" & PartDesc & ".pdf"
End If
ShellExec File
End Sub