Kamis, 19 Mei 2011

RE: [MS_AccessPros] Loading Combo Box

 

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

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar