Solved

Set combo to "" after user update in Excel form with VBA

Posted on 2011-03-16
6
349 Views
Last Modified: 2012-05-11
I have a form whereby theuser updates underlying data.  It can be an update to existing data or the user can close the account.  What I would like (and can't seem to get done), is when the user closeds an account, the data is removed from the underlyiing worksheet and the form empties.  However, the "group" combo box still reflect the group the user selected.  How can I simply set this to an empty text string?  I don't want the drop-down items to disappear, I just want a blank control.  I tried setting it to "", but that did not work.
0
Comment
Question by:ssmith94015
  • 3
  • 2
6 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35150801
You need to add "" as a possible value in the value list. Then you can set the box to an empty string.

Kevin
0
 
LVL 33

Expert Comment

by:jppinto
ID: 35150807
cboName.Text=""
0
 

Author Comment

by:ssmith94015
ID: 35150811
It is an item, but it simply won't reset.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35150831
Then use the Clear method:

ComboBox1.Clear

Kevin
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 35150902
Another technique:

ComboBox1.ListIndex = -1

This maintains the list while clearing the entry field.

Kevin
0
 

Author Closing Comment

by:ssmith94015
ID: 35150957
That did it, thank you.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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 use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

856 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