Subject Re: [IBO] Restoring a LookupCombo box value
Author Paul Schmidt
Svein:
On 2 May 2001, at 12:01, Svein Erling Tysvær wrote:


> >I will make an assumption here that I can add a new record using
> >TIB_Query,
> and
> >filling in the values I want a la TTable. Is this a safe assumption?
>
> Probably, if you mean that you can use FieldByName('Paul').AsString,
> AsDateTime etc. The main difference I can think of, is that you better
> get familiar with transactions, and that C/S development is quite
> different from desktop development when talking about speed.

That is exactly what I mean, most of the application uses the normal
IBO tools, this particular table only gets insertions, based on the
values and calculations that take place. The data is only used to
update other tables (via triggers), and to get reported on.

> >Now, I would like to be able to store PHASE_ID in the flat file, and
> >then
> when we
> >restart the program and read this value into the TIB_LookupCombo so
> >that it shows the value, sort of as a persistant object. Is this
> >doable, or should
> I use
> >TIBO_Query, or worse do I need to troll the table, I only look at
> >about 30
> active
> >records at any one time, so I don't mind.
>
> Do you mean simply
> TIB_Query1.FieldByName('Phase_ID').AsInteger:=PaulsIntegerVariable; ?
> I don't quite understand what you're after, but I think a
> TIB_LookupCombo or a TIB_ComboBox may be what you want.
> TIB_LookupCombos requires that both master and lookup datasets are
> correctly set up as well as their datasources - if they're not you'll
> just have a LookupCombo that doesn't work without telling you why and
> probably face a few hours of debugging if done for the first time. The
> Getting Started Guide is great for TIB_LookupCombos.
>

Okay, there is a table called PHASE, each record has a PHASE_ID, I
want a ComboBox that gets filled with PHASE.DESCRIPTION values. I
select a value in the ComboBox, and press a button, it writes the
PHASE_ID that matches that description and the current time into a
flat file. After an amount of time, I press the button again, and
it then creates a TIMECARD record, and deletes the flat file.

When the program starts, it looks for the flat file, if it exists, it
assumes that it never got the end-time, meaning I either ended the
program, or Windows exploded. So it reads the two values out of the
file, and restores the variables. I would like that if the ComboBox
was pointing to a specific record when it wrote the flat file, that
it be pointing to the same record after we restore the values from
the flat file.

Thanks,


Paul

Paul Schmidt,
Tricat Technologies
Email: paul@...
Website: www.tricattechnologies.com