Solved

Why doesn't my Excel VBA listbox populate the User form fields ?

Posted on 2014-03-12
2
627 Views
Last Modified: 2014-03-12
Hi,

I have an Excel 2010 User form made up of Active X controls (text boxes and a listbox).

The listbox displays an abbreviated list of all the rows on the sheet. On opening the form the most recent record (that is, the record that appears at the bottom of the list in the list box) is displayed in the form fields.
 
The user can click on any record in the list box and the relevant sheet row populates the form fields.

To do this, my VBA procedure transfers the sheet data into an array and then subsequently populates the relevant text box controls and the listbox from the array.

However, if a sheet cell contained a string of more than 255 characters the application crashed. The application has now been modified to cope with this problem by using a single column MATCH function. On opening the user form the field now displays the string of more than 255 characters correctly.

But there is still a problem. If you select another record in the list box and THEN select the most recent record again from the list box, nothing happens. The most recent record is ignored.

I'm at a loss as to why this record doesn't display, other than it contains a field with more than 255 characters.

The application is attached. Click on the 'CONTRACTS' button on the sheet. The procedure in question is liContracts_Click()

Any help would be appreciated.

Regards
Toco
Contracts3.xlsm
0
Comment
Question by:Tocogroup
2 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39923175
HI,

Do you mean that if you click another contract and the return to contract 76 you cannot see the text in notes?
pls try this version

Regards
Contracts3v1.xlsm
0
 

Author Closing Comment

by:Tocogroup
ID: 39923765
Hah. You condensed my preamble into 20-odd words.
Many thanks
Toco
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now