Solved

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

Posted on 2011-03-16
6
348 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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 …
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…

772 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