Solved

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

Posted on 2014-03-12
2
640 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

635 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