R
Richard
I am working on a multi-user form / subform one to many relationship. Two
data tables, master table (tblWarehouse) primary key set to WareID /
autonumber child table (tblPurchData) primary key set to PurchaseOrderID /
autonumber with a foreign key WareID from the master table. I want to be able
to print direct from the form. I have used this code in the past found on
Allen Browne's web page.
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
My question is can this be adapted to my situation? I have tried it with no
luck..any help or examples would be most appreciated..
data tables, master table (tblWarehouse) primary key set to WareID /
autonumber child table (tblPurchData) primary key set to PurchaseOrderID /
autonumber with a foreign key WareID from the master table. I want to be able
to print direct from the form. I have used this code in the past found on
Allen Browne's web page.
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
My question is can this be adapted to my situation? I have tried it with no
luck..any help or examples would be most appreciated..