Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

switch clearing

ResolvedVersion 2003

James has attended:
Excel VBA Intro Intermediate course
Access Intermediate course

Switch Clearing

When I select a salesperson or Manufacturer to run a form on, it is still possible to change the first drop down box and the salesperson or Manufacturer remains.

If I click "Go" at this stage, the wrong programme runs.

Is there any way to clear the second drop down box as soon as the value in the second is changed?

RE: Switch Clearing

Hi James

Thanks for your question

You need to create a change event for the first combo box. In that event you need one line of code

me.cmbreptype.value = ""


This will remove the entry, the entry in the selection combo, the instant you change the entry in the reptype combo.

The afterupdate method doesn't fire until you click on another control, and this is the reason it wasn't working from there

Regards

Stephen

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Create own ribbon tab - Excel 2010

a. In Excel click on the File tab
b. Select Options from left hand side
c. Choose the Customize Ribbon section
d. Click the New Tab button (below the list of tabs on the right hand side of the dialog box)
e. Select the New Tab (Custom) and enter a name, by clicking the Rename button (below the list of tabs on the right hand side of the dialog box)
f. Select the New Group (Custom) and enter a name, by clicking the Rename button (below the list of tabs on the right hand side of the dialog box)
g. Add commands to your tab and group by locating them on the list on the right hand side (remembering that you can change the list using the drop down box at the top of the list of commands) and clicking the Add button between the two panes to add them to your tab and group
h. You can rearrange the commands in your group, the groups on any tab or the tabs, using the up and down arrow buttons beside the list of tabs.
i. Click OK to apply your changes

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.