assign ID (1 Viewer)

Pavczech

Registered User.
Local time
Today, 22:56
Joined
Jul 11, 2012
Messages
41
Hi guys

Could you help me please.

I have 2 tables with relationship.
I have 2 forms related to those tables.

I need the code which would first find the ID in table 1 and than transfer this ID to the ProductID on the Form2.

So Far I have this but it doesnt seems to be working

Private Sub Form_AfterUpdate()
Form_Form2![ProductID] = DLookup("[ID]", "Table1", "[ID] = " & Nz([ID], 0))
End Sub

I does transfer the ID to the table2 but on its own the rest of the record is on another row.

Hope this makes sence
Thanks
 

John Big Booty

AWF VIP
Local time
Tomorrow, 07:56
Joined
Aug 29, 2005
Messages
8,263
Can you not achieve this with a form and subform set? In this way the tables will be automagically linked behind the scenes by Access and you will not require any additional code.
 

Users who are viewing this thread

Top Bottom