Unbound List value for docmd.gotorecord

Geogeorge

New member
Local time
Today, 15:52
Joined
Apr 14, 2009
Messages
8
Hey.
I got great help for my last question so thought I might come back :D
Im having a little trouble with using an unbound list box as a control for a docmd.gotorecord action.
Ok so I have a relatively simple setup with a Main form (Mainform1) and related subform (subform1) related by a unique key the Mainform1 data source table (OID).
In addition to this I have an unbound List box on the Main form called (Listbox1) that contains 4 columns of queried values from the Mainform source table. The OID is in the first column.

I would ideally like to create an update action that uses the selected value in the list box to go to the relevant record in Mainform1 (cascading the subform1).

I created an "onupdate" action for the list, but obviously I fail at Access :P

Private Sub Listbox1_AfterUpdate()
DoCmd.GoToRecord acDataForm, Mainform1.OID, acGoTo, Listbox1.Column(0)
End Sub

Any advice on what I'm doing wrong?
Is this the completely wrong approach?
Thanks :D
 

Users who are viewing this thread

Back
Top Bottom