Kamis, 19 Mei 2011

RE: [MS_AccessPros] Loading Combo Box

 

Mike-

Have you saved the ID in a Public variable? If so, you need to set the value of
the combo box to that variable. If it's in a hidden form, set the value to the
value from that form.

Me.CMB_PLATFORM = Forms!HiddenForm!txtCurrentCust

.. or something like that.

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 mithomas48
Sent: Thursday, May 19, 2011 8:51 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Loading Combo Box

John, it is unbound. The value of "4" (in the hard coded example) actually is
dynamic and coming from a hidden form. There isn't a control on the form that
I'm assigning this value to. I'm just using it in the SELECT statement to
return the initial value.

We have three clients. The user selects a client when they open the database.
From that point, everything the user does is limited to that client. Users have
multiple queues and when they open a queue, there is a combo box that will allow
them to switch clients. It is here that we want the combo box to show the
initial client when they open the queue. So, when if they selected "WAMU" when
they opened the db, the queue also needs to show "WAMU" in the combo box when
they open it. The combo box is used to tell them what client they are in, and
give them the option to switch. Hope that helps.

Thanks again!
Mike

--- In MS_Access_Professionals@yahoogroups.com, "John Viescas" <john@...> wrote:
>
> Mike-
>
> Is the combo bound to anything? In other words, does it have a Control
Source?
> If the combo is unbound, perhaps what you want to do is set its value in the
> Current event of the form so that it matches the "current" record. Is there a
> control on the form that matches the bound value?
>
> 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 mithomas48
> Sent: Thursday, May 19, 2011 8:03 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: Re: [MS_AccessPros] Loading Combo Box
>
> John, we need it to display the returned value from the table/field. The
SELECT
> is pulling two fields, one for each column in the combo box. The second
> column's length is set so that it is viewable in the combo box. the first
> column is a number and the second is a string. In the example I sent, the
> criteria is a value of 4 which will return the same number value for column 1,
> and "WAMU" for the second column. The idea is, when the form opens the combo
> box will display "WAMU".
>
> --- In MS_Access_Professionals@yahoogroups.com, "John Viescas" <john@> wrote:
> >
> > Mike-
> >
> > Unless you set the value of the combo box, it has a default value that
matches
> a
> > returned value, or is bound to a field in the underlying recordset that has
a
> > matching value, the combo box will appear blank. What do you want so show
up?
> > If you want the combo to display the first item in the list, do:
> >
> > Me.CMB_PLATFORM = Me.CMB_PLATFORM.ListIndex(0)
> >
> >
> > 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 mithomas48
> > Sent: Wednesday, May 18, 2011 11:23 PM
> > To: MS_Access_Professionals@yahoogroups.com
> > Subject: [MS_AccessPros] Loading Combo Box
> >
> > Need help loading a combo box on the on open event. We need the combo box
to
> > show the values returned in the SELECT statement when the form opens. The
> combo
> > box has 2 columns and 1 is bound. Column widths are set to 0";1". Here is
> the
> > SELECT statement that is working correctly.
> >
> > Me.CMB_PLATFORM.RowSource = "SELECT LOOKUP_VALUE, LOOKUP_DESC FROM
> > LSDMGR_MOD_LOSS_MIT_LOOKUP " & _
> > "WHERE (((LOOKUP_TYPE)='PLATFORM_LEVEL') " & _
> > "AND ((LOOKUP_VALUE) = 4));"
> >
> > The SELECT is pulling the correct data in the two fields, it's just not
> > displaying in the combo box when the form opens.
> >
> > Thanks in advance!
> > Mike
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

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

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.

.

__,_._,___

Tidak ada komentar:

Posting Komentar