Home > Archive > Programming with dBASE > March 2006 > Combobox









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Combobox
Stuart Tobin

2006-03-24, 8:24 pm

I would like to use a combobox set to datasource. This way, all names in a database are available. Problem is that even though I can choose any name in the combobox, I can't get any other field data for that name. I.E. datasourced field is "NAME." Another
field in that rowset is "AMOUNT." I can not figure a way to get data located in "AMOUNT."

If I use a listbox, no problem.

Is there a way to use a combobox and have available all fields in the rowset for the field that is datasourced?

Stuart,
Charlie Lutz

2006-03-27, 7:26 am

In article <Zq3p6Y5TGHA.1152@news-server>, sttobin@comcast.net says...
> I would like to use a combobox set to datasource. This way, all names in a database are available. Problem is that even though I can choose any name in the combobox, I can't get any other field data for that name. I.E. datasourced field is "NAME." Anoth

er field in that rowset is "AMOUNT." I can not figure a way to get data located in "AMOUNT."
>
> If I use a listbox, no problem.
>
> Is there a way to use a combobox and have available all fields in the rowset for the field that is datasourced?

Stuart,
A combobox reads the data from the datasourced field into an array when
it is initiated. There fore the data in the combobox is static. You
will need to grab the value of the combo box, then using that value set
a filter, or locate or search the table to find the record attached to
that value and then you can grab any of the other data from that record.
The combobox is not "attached" to the table it gets the fields from.
That is also why you will not see a new record's data in the combobox if
it has been added after the initial instance was created unless you re-
state the datalink.

Hope this makes sense to you.

Charlie
--


____________________
________
Charlie Lutz
#1000441
Ken Mayer [dBVIPS]

2006-03-27, 9:24 am

Stuart Tobin wrote:
> I would like to use a combobox set to datasource. This way, all names in a database are available. Problem is that even though I can choose any name in the combobox, I can't get any other field data for that name. I.E. datasourced field is "NAME." Anoth

er field in that rowset is "AMOUNT." I can not figure a way to get data located in "AMOUNT."
>
> If I use a listbox, no problem.
>
> Is there a way to use a combobox and have available all fields in the rowset for the field that is datasourced?


A combobox is not meant to navigate a table. As Charlie points out, when
the form is instantiated, the dataSource is static -- if you add rows or
change data, the combobox is not updated. When you select a value in the
combobox, the rowset does not navigate to that row ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Stuart Tobin

2006-03-27, 11:24 am

Charlie,

I had come to that conclusion but was hoping I was wrong.

Thanks,

Stuart,

Charlie Lutz <lutzc@(remove)wes.army.mil> Wrote:

> In article <Zq3p6Y5TGHA.1152@news-server>, sttobin@comcast.net says...
ther field in that rowset is "AMOUNT." I can not figure a way to get data located in "AMOUNT."[color=darkred]
> Stuart,
> A combobox reads the data from the datasourced field into an array when
> it is initiated. There fore the data in the combobox is static. You
> will need to grab the value of the combo box, then using that value set
> a filter, or locate or search the table to find the record attached to
> that value and then you can grab any of the other data from that record.
> The combobox is not "attached" to the table it gets the fields from.
> That is also why you will not see a new record's data in the combobox if
> it has been added after the initial instance was created unless you re-
> state the datalink.
>
> Hope this makes sense to you.
>
> Charlie
> --
>
>
> ____________________
________
> Charlie Lutz
> #1000441


Stuart Tobin

2006-03-27, 11:24 am

Hi Ken,

Thanks for the confirmation of Charlie's response. I had come to the same conclusion but was hoping I was wrong.

Stuart,

Ken Mayer [dBVIPS] Wrote:

> Stuart Tobin wrote:
ther field in that rowset is "AMOUNT." I can not figure a way to get data located in "AMOUNT."[color=darkred]
>
> A combobox is not meant to navigate a table. As Charlie points out, when
> the form is instantiated, the dataSource is static -- if you add rows or
> change data, the combobox is not updated. When you select a value in the
> combobox, the rowset does not navigate to that row ...
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase


Ken Mayer [dBVIPS]

2006-03-27, 8:24 pm

Stuart Tobin wrote:
> Hi Ken,
>
> Thanks for the confirmation of Charlie's response. I had come to the same conclusion but was hoping I was wrong.


This is discussed in my book as well ... (hint, hint ... <g> )

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Les Shewchuk

2006-03-27, 8:24 pm


"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
news:dQfpTdaUGHA.2068@news-server...
>When you select a value in the combobox, the rowset does not navigate to
>that row ...


The only time it does navigate, is if you are using a lookup rowset. But
that is a different beast from what you seem to be doing.

> the dataSource is static -- if you add rows or change data, the combobox
> is not updated.


This however remains true even with a lookup set. Adding new rows to the
lookup table doesn't automatically update the datasource.

Les Shewchuk


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com