Solved

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

Posted on 2014-03-12
2
631 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 50

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

830 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