Automatically open a pop up form based on info from another form

D

Deb Struble

I have a form in datasheet view that shows all the Purchase Order
Information (PO #, Item #, Supplier Name, Qty, Cost). Rather than adding
all the Supplier Information (Address, Phone #, etc) to this form as well I
would like the user to be able to double click on a Supplier Name and it
would automatically open a pop-up window displaying all the Supplier
Information (Address, Phone #, ect). Does anyone have any ideas on how I
would do this? This is what I originally used but it gives me an error and
it doesn't pull the correct Supplier information.
Private Sub SupplierName_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmSupplierView2", acNormal
Me.SupplierID = Forms.PObyPartView2.SupplierID
End Sub
Thanks in advance for any help!
 
D

Deb Struble

I posted my question too soon...sorry for any inconvenience. I was reading
through more of the other posts and found my answer. This is what I did if
any one is interested.
Private Sub SupplierName_DblClick(Cancel As Integer)
On Error GoTo Err_cmdOpenSupplierView_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmSupplierView2"

stLinkCriteria = "[SupplierID]=" & "'" & Me![SupplierID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenSupplierView_Click:
Exit Sub

Err_cmdOpenSupplierView_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdOpenSupplierView_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top