Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-03-12
2
Medium Priority
?
648 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
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 Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

916 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