Minggu, 26 Agustus 2012

RE: [MS_AccessPros] How to let contents of one combo box affect contents of another combo box

 

Dennis-

Well, in the After Update event of "A", if it's not a hotel-related item, set
combo B to Null and set Locked = True. You'll also probably need code in the
Current event of the form to unlock combo B unless the row already contains a
non-hotel event.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dennis Davidsson
Sent: Sunday, August 26, 2012 5:56 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to let contents of one combo box affect
contents of another combo box

Thanks John,

I am not quite sure what level of detail I should give you, but I will try:
The combo boxes are actually part of a subform for order details. The outer
order form is used to register basically hotel bookings, and the combo box B in
my mail is used to present the available alternatives of hotel names, and the
combo box A presents a list of available types of rooms, like double room,
single room, extra bed, etc.
However, there are also other "product types", that may be ordered on an order
detail line like e.g. dinner, sightseeing tickets, program catalog, etc. And for
those types there is no connection to a specific hotel name. So for those cases
I want the program to fill in a default value indicating there is no hotel
involved. And thus making it possible for the keying user to just skip that box
and continue to the remaining relevant boxes on the order detail line. The data
source behind the combo box B is simply a table containing all available hotel
names and a number as primary key.

Well that was trial to give some more details.
Hope you have got the picture now roughly.

regards
Dennis

26 aug 2012 kl. 17:19 skrev John Viescas:

> Dennis-
>
> Yes, you could certainly do that in the After Update event of the first combo
> using VBA. Would need more details before I can give you sample code.
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dennis Davidsson
> Sent: Sunday, August 26, 2012 3:26 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] How to let contents of one combo box affect contents
of
> another combo box
>
> Hello,
>
> I have a form containing a combo box A and another combo box B. Depending on
> what the user selects from the available alternatives in combo box A, I want
the
> code to force a certain choice among the alternatives in combo box B without
the
> user having to select the combo box B at all.
> Could I achieve this by adding some smart VBA code e.g. on the 'After Update'
> event of the combo box A?
> Or is there some other better way?
>
> Regards
> Dennis Davidsson
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar