Problems programming drop-down ListBox 
Author Message
 Problems programming drop-down ListBox

Hi, I'm trying to populate a drop-down list box with
values from a table ... so far all OK.

But ... I only want a subset of the table shown in the
drop-down and what I want to display is based on a value
on the form.

i.e. I want to display all contacts from table_contact
where contactclientno = clientno on the current record of
the form (record displayed is from table_client and there
is a relationship between the two tables)!!!

I've tried to set ListRowSource and ListDisplayField
within VBScript but it won't allow me to set these ... any
ideas much appreciated!!

Paul



Thu, 22 Jul 2004 10:55:48 GMT  
 Problems programming drop-down ListBox
Original problem solved! ..... I now have a DAP that I can
open within Access 2002 and it displays everything OK...

BUT! When I open the page in IE6 I get an 'object
required' error message.

The Sub that causes the error message is:

SUB UpdateInvoiceRecipientCombo(oEventInfo)

Dim sect
Dim chConstants
Dim stWhere

        fInited = TRUE

        set sect = oEventInfo.DataPage.FirstSection
        set chConstants = MSODSC.constants

        while (not(sect is nothing))
                if sect.type = chConstants.sectTypeHeader
then

                        stWhere = "ClientContactAddressNo
in (SELECT ClientAddressNo FROM Table_Client_Address WHERE
ClientAddressClientNo = " & sect.HTMLContainer.children
("ClientNo").innertext & ")"

                        MSODSC.RecordsetDefs.Item
("Table_Client_Contact1").ServerFilter = stWhere

                end if

                set sect = sect.nextsection
        wend
end sub

This sub is called from:

<SCRIPT language=vbscript event=DataPageComplete
(oEventInfo) for=MSODSC>
<!--

        if (fInited = FALSE And
oEventInfo.DataPage.GroupLevel.RecordSource
= "Table_Client") then

                UpdateInvoiceRecipientCombo(oEventInfo)
        end if
-->
</SCRIPT>

The message is:

 'Error: Object Required: 'sect.HTMLContainer.children
(...)'

.. and it appears before the frame has visibly loaded ...
could it be that I am trying to reference a screen item
that doesn't exist yet?? if so, how can I get around this??

Quote:
>-----Original Message-----
>Hi, I'm trying to populate a drop-down list box with
>values from a table ... so far all OK.

>But ... I only want a subset of the table shown in the
>drop-down and what I want to display is based on a value
>on the form.

>i.e. I want to display all contacts from table_contact
>where contactclientno = clientno on the current record of
>the form (record displayed is from table_client and there
>is a relationship between the two tables)!!!

>I've tried to set ListRowSource and ListDisplayField
>within vbscript but it won't allow me to set these ...
any
>ideas much appreciated!!

>Paul
>.



Fri, 23 Jul 2004 20:49:24 GMT  
 Problems programming drop-down ListBox
Try to use document.All("id_of_object").<name_of_property>

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Sat, 24 Jul 2004 17:48:23 GMT  
 Problems programming drop-down ListBox
You should try to filter the underlying recordset returned from the
database.

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Sat, 24 Jul 2004 17:46:30 GMT  
 Problems programming drop-down ListBox
Thanks Gary

I shouldn't have been trying to use the value of the screen object at all
... as soon as I changed it to obtaining the value of the data item it
worked fine!!


Quote:
> You should try to filter the underlying recordset returned from the
> database.

> This posting is provided ?AS IS?, with no warranties, and confers no
> rights.



Sun, 25 Jul 2004 02:02:12 GMT  
 Problems programming drop-down ListBox
Glad to hear of it :-)

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Tue, 27 Jul 2004 09:42:28 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Redistributable Files

2. Drop Down List Box - Drop Down portion does not always disappear after Click event

3. Press F1 key while drop-down menu item highlighted, drop-down menu stays on top

4. Data bound drops downs dont drop down!

5. VBA code to go to a bookmarked drop down goes to wrong drop down

6. drop down listbox

7. Is there a drop-down listbox out there ?

8. Drop-down Listbox - programatically setting the selected item

9. HELP: Fonts in drop-down listbox?

10. HELP: Fonts in drop-down listbox?

11. win95 Drive Drop Down Listbox

12. Drop-down ListBox with Imagelist?

 

 
Powered by phpBB® Forum Software