Pop up window linking two forms

Nishikawa

Registered User.
Local time
Today, 03:21
Joined
May 17, 2007
Messages
97
Hi,

I have been trying to create a popup window that show information of two different form. Both form have the same primary key.

I tried using the same code in Northwind (In "Suppliers" Form) but with not much success. the code that I copied was:

Private Sub ReviewProducts_Click()
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String

strDocName = "Product List"
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria

End Sub

All I edited was the strLinkCriteria. The popup worked but it just show a blank form with no information in it.

Please help!! Did I use the wrong code?
 
Change this:
Code:
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"

to this
Code:
strLinkCriteria = "[SupplierID] = " & Forms![Suppliers]![SupplierID]
 
Hi,

the system gave me an error, stating that the form cannot be found. I have counter check the form name and it is correct.

Here is the code again. (I renamed a few parts)

Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String

strDocName = "Comments List"
strLinkCriteria = "[Key II] = " & Forms![Comments List]![Key II]
DoCmd.OpenForm strDocName, , , strLinkCriteria
 
I have found the mistake. Silly me!! it is the name of the form that is wrong.

Thanks for your help bob!!!
 

Users who are viewing this thread

Back
Top Bottom