List Box Problems

B

Brandon Schultz

I have created a list box so that I can navigate through records. The
AfterUpdate event looks like this;
Me.RecordsetClone.FindFirst "[SOD_SalesOrderID] = '" & Me![lstSalesOrders] &
"'"
Me.Bookmark = Me.RecordsetClone.Bookmark

SOD_SalesOrderID is a primary key for the query the list pulls from but
there are duplicate SOD_SalesOrderID records for multiple line numbers
(SOD_SOLineNbr). So, although the list populates with the the records
whenever you select Sales Order line number 2, 3, 4 etc. it does not pull up
the records data in the corresponding text boxes I have on the form. Only
the first line number pulls in ok. I end up having to use the navigation
buttons on the bottom; Which I'd like to eliminate.

Any help would appreciative.

Brandon Schultz
 
S

Steve Dunn

Please note that I am very new at this and the Gurus here
probably have a better answer.


Recently I had a similar problem with a combo box that I
use to look up company names. I have some companies with
the same names but different id numbers so findfirst
would always find the first company listed. What I did
was create an autonumber field for my companies table so
that I had a unique number to look up them with. I then
looked them up using findfirst to goto the record with
the applicable unique number. OR

I think you can use the column property of the list box
to get the value of SOD_SOLineNbr and use an 'AND' with
it and SOD_SalesOrderID in Findfirst to go to the proper
record.
 

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