At a loss with listboxes...

gkaste

Registered User.
Local time
Today, 14:52
Joined
Aug 5, 2003
Messages
22
I am using Access 97.

I have a form open, which contains a listbox and a single button, designed to open a record, based on the selection the user names in the listbox. The listbox has two pieces of information, a Vendor ID, and a Vendor Name, supplied by a table(which contains more than those two items). When a user selects the vendor he wants a record for, he should be able to hit the button and open a new form, filled in with the record specific to that Vendor ID. For some reason though, the form will open, but it will be blank.

Here is my code on the button:

Private Sub OpenSelected_Click()

DoCmd.OpenForm "Vendor Information", , , "VendorID" = Me.NameList.Column(0)

End Sub



I have played around with all differen formattings for the where statement. The column(0) is the column with the Vendor ID. The column with the Vendor ID is also the bound column, and I have tried Me.NameList.BoundColumn, but that does not work either.

Anyones ideas would be greatly appreciated. I have searched many many websites and only found that this process should work.


Thank you
Garrett Kaste
Phoenix America Inc.
 
Sorry, forgot to note a few things:


NameList is the listbox

Vendor Information is the new form I want to open

VendorID is the name of the column on my table (called Vendors) both of which the listbox information is taken from, and new form I want to open(Vendor Information) will display information based on the selection
 
A loss with list box

Have a go with this. It works in A2000

Private Sub WOSearch_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmWorkOrder", , , _
"[WorkOrder.WorkOrderID] =" & Me.WOSearch.Column(0)
End Sub

Description
WOSearch is the List box

The form to be opened is called frmWorkOrder

The [WorkOrder.WorkOrderID] is the record index for the form to be opened in relation to the record you select in the listbox ( Me.WOSearch.Column(0) )

This is under the DoubleClick param for the list box
Hope it works
 

Users who are viewing this thread

Back
Top Bottom