Home > Archive > Programming with dBASE > November 2005 > combo control update









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 combo control update
Lloyd

2005-11-08, 9:24 am

There are two forms, one form contains a combo box datalinked to a transaction customer field with an sqllookup in the customer table to the customers name. Form 2 is the customer mainenance form. The combo box control has no datasource due to the sqllo
okup connection. The customer name is displayed in the combo box, but the customer id code which is an autoincrement fields is saved in the transaction table.

My question is : " How can the combo box control be refreshed when form one is open and while it is open a new cutomer is added in form 2."

Thanks for your help
Ken Mayer [dBVIPS]

2005-11-08, 9:24 am

Lloyd wrote:
> There are two forms, one form contains a combo box datalinked to a transaction customer field with an sqllookup in the customer table to the customers name. Form 2 is the customer mainenance form. The combo box control has no datasource due to the sql

lookup connection. The customer name is displayed in the combo box, but the customer id code which is an autoincrement fields is saved in the transaction table.
>
> My question is : " How can the combo box control be refreshed when form one is open and while it is open a new cutomer is added in form 2."


Form.combobox.dataSource := form.combobox.dataSource

This restates the datasource and should force a reload of the data.

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
Lloyd

2005-11-08, 3:58 pm

Thank you for your reply. I have used that method successfully when a datasource has been identified. On this situation there is no datasource assigned to this property because of the sqllookup on the field. Would reassigning the datasource work in this
instance with this control?

Ken Mayer [dBVIPS] Wrote:

> Lloyd wrote:
qllookup connection. The customer name is displayed in the combo box, but the customer id code which is an autoincrement fields is saved in the transaction table.[color=darkred]
>
> Form.combobox.dataSource := form.combobox.dataSource
>
> This restates the datasource and should force a reload of the data.
>
> 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]

2005-11-08, 3:58 pm

Lloyd wrote:
> Thank you for your reply. I have used that method successfully when a datasource has been identified. On this situation there is no datasource assigned to this property because of the sqllookup on the field. Would reassigning the datasource work in th

is instance with this control?

If you are datalinked to a lookupSQL field/table, try restating the
datalink.

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
Lloyd

2005-11-09, 3:23 am

I have also attempted to use the beforeGetValue and canChange field properties in a datamodule to morph the data. In doing so the datasource could be refreshed. I am currently using Version 2.21 B1755. The canChange property appears to be function cont
rary to the description in help files and manual. Each time the combobox control is changed, an error message appears stating that to many UDF's are open and the form terminates. With the code attached to the field, which is structured almost identicall
y to the on line help examples, the canChange field property seems to continue to fire.

This is the text from the help file:
"You can also use canChange to reverse the field morphing performed by beforeGetValue. Inside the canChange event handler, examine the <new value> parameter and assign the value you want to store in the table directly to the value property of the Field ob
ject. Doing so does not fire canChange recursively. Then have the canChange event handler return false so that the <new value> does not get saved into the row buffer."

I'm certain that I have missed something. Any suggestions are appreciated

Lloyd
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