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

x
?
Solved

cleaning a LisIndex -1

Posted on 2003-12-10
4
Medium Priority
?
246 Views
Last Modified: 2010-05-18
Hi, I have a form in Visual Basics. when this form loads it fills a combobox and this info comes from an Access databases. Also when you click this combobox it displays the description of the selection in another textbox.
and then when i save a record i want the form to clean up all textboxes and comboboxes.  so i tried to write after the save statement "cbobox.listindex = -1" but it doesn't work.  because it goes back to the click statement. do you know what i can do..
hopefully i made myself clear. please let me know if you need a better explanation. Thanks a lot.
0
Comment
Question by:mapy
  • 2
4 Comments
 
LVL 6

Expert Comment

by:srimanth
ID: 9913879
try:

cbobox.clear         'Clears the ComboBox
textbox.text = ""   'Clears the textbox

cheers,
srimanth.
0
 
LVL 14

Accepted Solution

by:
aelatik earned 2000 total points
ID: 9913883
'Make a boolean var like CLEANING

Dim CLEANING As Boolean

' In your click event check for that var before activating

Private Sub cbobox_Click()
    If CLEANING = False Then
        ' Exucute your code
    End If
End Sub

' When your clearing the listindex set CLEANING to true and the click event won't execute
' When done just set the CLEANING var to false and the click event will work again.
0
 
LVL 14

Expert Comment

by:aelatik
ID: 9913894
Now im confused, do you mean clearing the controls or setting it to its begin value ( deselecting everything )
0
 

Author Comment

by:mapy
ID: 9914993
yes, after saving a record i want to set it up to its begin value.
thank you all, but aelatik is right.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

926 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