Board index » delphi » Accessing tdbedit's data when control is set not visible

Accessing tdbedit's data when control is set not visible

I want to access the value of the associated data field for a tdbedit
when the control is not visible, but doing something like

theStr := fDataLink.field.AsString

doesn't seem to work. In fact, the value assigned to theStr from
fDataLink.field.AsString seems to be the last value accessed while the
control was visible -- even after scrolling through different records.

What can I do about this?

-Ted

 

Re:Accessing tdbedit's data when control is set not visible


Turns out I misdiagnosed the source of the problem.

The text field of a tdbedit does indeed update on a record change even if
the tdbedit is not visible. My failure to access and use the text field
from the tdbedit when the tdbedit was invisible was caused by my failure
to manually call invalidate on a data change which would then force
textout() to draw. When the control was set visible, I didn't need to
invalidate since the tdbedit was automatically invalidated by the data
change.

Quote
Ted Michon wrote:
> I want to access the value of the associated data field for a tdbedit
> when the control is not visible, but doing something like

> theStr := fDataLink.field.AsString

> doesn't seem to work. In fact, the value assigned to theStr from
> fDataLink.field.AsString seems to be the last value accessed while the
> control was visible -- even after scrolling through different records.

> What can I do about this?

> -Ted

Re:Accessing tdbedit's data when control is set not visible


Quote
>I want to access the value of the associated data field for a tdbedit
>when the control is not visible, but doing something like

>theStr := fDataLink.field.AsString

Go directly to the dataset

fdatalink.datasource.dataset.fieldbyname('yourfiled').asString

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Accessing tdbedit's data when control is set not visible


Brian-

I tried directly accessing the database as well, but neither that nor
using the edit.text worked because (as I previously posted) I had messed
up the data display itself. It turns out, in fact, that you can access
tedit.text.

Thanks.

-Ted

Quote
Brian Bushay TeamB wrote:
> >I want to access the value of the associated data field for a tdbedit
> >when the control is not visible, but doing something like

> >theStr := fDataLink.field.AsString

> Go directly to the dataset

> fdatalink.datasource.dataset.fieldbyname('yourfiled').asString

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads