AfterUpdate Event Procedure (1 Viewer)

Dhamdard

Dad Mohammad Hamdard
Local time
Today, 12:26
Joined
Nov 19, 2010
Messages
103
I think event procedure for normal combo box and multiple-value-select combo box is different. I have 'station' and 'language' combo boxes. Both are multi-value-select combo boxes. This means that more than one item can be selected from the drop down list.

When the value of 'station' combo box is 'Nationwide', then I want that all values on the combo box list in 'Language' field is automatically selected.

How should I write the after update procedure? I have been having fun with it for the last two days.

Your help is much appreciated.

Regards,
Dad
 

vbaInet

AWF VIP
Local time
Today, 08:56
Joined
Jan 22, 2010
Messages
26,374
Dhamdard,

Why are you continuously asking this same question between 3 threads?

Loop through your listbox and set the Select property of each item to the index.
 

Dhamdard

Dad Mohammad Hamdard
Local time
Today, 12:26
Joined
Nov 19, 2010
Messages
103
VBA AfterUpdate Event Procedure

I think event procedure for normal combo box and multiple-value-select combo box is different. I have 'station' and 'language' combo boxes. Both are multi-value-select combo boxes. This means that more than one item can be selected from the drop down list.

When the value of 'station' combo box is 'Nationwide', then I want that all values on the combo box list in 'Language' field is automatically selected.

How should I write the after update procedure? I have been having fun with it for the last two days.

Your help is much appreciated.

Regards,
 

Dhamdard

Dad Mohammad Hamdard
Local time
Today, 12:26
Joined
Nov 19, 2010
Messages
103
Thanks, dude. I am completely confused as have never worked with multi value combo box before. Thanks for your info. Could you write up a sample code for loop and then for setting the index property?

Dad
 

vbaInet

AWF VIP
Local time
Today, 08:56
Joined
Jan 22, 2010
Messages
26,374
I'm sure you know enough about Access to do your own research.

Look in the helpfiles for Listbox.Selected and you may find an example. To loop through, use a For Each loop.

Write up something and see how you get on. If you have further questions, please ask.
 

pieropingi

New member
Local time
Today, 09:56
Joined
Dec 2, 2011
Messages
5
Re: VBA AfterUpdate Event Procedure

Here you have a solution, academic level ;)

allenbrowne.com/func-12.html
 

pieropingi

New member
Local time
Today, 09:56
Joined
Dec 2, 2011
Messages
5
Here you have a solution, academic level ;)

allenbrowne.com/func-12.html
 

Dhamdard

Dad Mohammad Hamdard
Local time
Today, 12:26
Joined
Nov 19, 2010
Messages
103
Re: VBA AfterUpdate Event Procedure


Hi,

We had a chat long ago about it. I couldn't make it. I would appreciate if you download attached light database and help me with;

In the form, there is a multiple value combo box named 'stations'. What I hope to do is that when I select 'Nationwide' then all stations on the same combo box must be selected automatically.

Your help is appreciated as usual.

Regards,
Hamdard
 

Attachments

  • MultipleValue.zip
    27.6 KB · Views: 125

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:56
Joined
Feb 19, 2002
Messages
43,565
Multi-value fields are a crutch and should never be used if you need to create queries or code that relies on them. Build your own many-side table and use a subform to manage the selections. It will be simple, straight-forward, and you can get help here.

FYI - listboxes with multiselect property set to yes are not bound and so events are not fired as they are with bound controls. That may be at play here also.
 

Users who are viewing this thread

Top Bottom