G
Guest
hello every one
I have this code from Northwind sample.
Private Sub ReviewProducts_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_ReviewProducts_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![CompanyName]) Then
strMsg = "Move to the supplier record whose products you want to
see, then press the Review Products button again."
intStyle = vbOKOnly
strTitle = "Select a Supplier"
MsgBox strMsg, intStyle, strTitle
Me![CompanyName].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "Product List"
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If
Exit_ReviewProducts_Click:
Exit Sub
Err_ReviewProducts_Click:
MsgBox Err.Description
Resume Exit_ReviewProducts_Click
End Sub
this will open another form with the same criteria.
what if i want to open a word document.
I want to use this for a (number) field.called "ourref"
suppose the office ducuemnt is located in D:\MyFiles\Word
and file names are serial numbers like 1,2,3
if the OurRef Number is 1.
then , if i double click this field , i want the code to open the word
docuemnt from the above location with the file name "1"
any help on this will be highly appriciated.
I have this code from Northwind sample.
Private Sub ReviewProducts_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_ReviewProducts_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![CompanyName]) Then
strMsg = "Move to the supplier record whose products you want to
see, then press the Review Products button again."
intStyle = vbOKOnly
strTitle = "Select a Supplier"
MsgBox strMsg, intStyle, strTitle
Me![CompanyName].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "Product List"
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If
Exit_ReviewProducts_Click:
Exit Sub
Err_ReviewProducts_Click:
MsgBox Err.Description
Resume Exit_ReviewProducts_Click
End Sub
this will open another form with the same criteria.
what if i want to open a word document.
I want to use this for a (number) field.called "ourref"
suppose the office ducuemnt is located in D:\MyFiles\Word
and file names are serial numbers like 1,2,3
if the OurRef Number is 1.
then , if i double click this field , i want the code to open the word
docuemnt from the above location with the file name "1"
any help on this will be highly appriciated.