Creating temporary fields

  • Thread starter Thread starter AlanD
  • Start date Start date
A

AlanD

I am displaying records in 'continuous form' format. All fields except 1
come from a table.

The extra field is just being used for control purposes, to validate the
input.

Can I create a temporary field to use, as part of the query?

I've tried using '0 AS controlfield'. This creates controlfield but
assigns the same value to all of the recordset, so changing one changes them
all.

Similarly I tried using an unbound field and changing it via a form event,
but again I'm just getting a single variable for all the recordset.

What's the proper way? (I could just add a junk field to the table and use
it, but it doesn't seem right.)

Thanks for any hints

Alan
 
AlanD said:
I am displaying records in 'continuous form' format. All fields except 1
come from a table.

The extra field is just being used for control purposes, to validate the
input.

Can I create a temporary field to use, as part of the query?

I've tried using '0 AS controlfield'. This creates controlfield but
assigns the same value to all of the recordset, so changing one changes them
all.

Similarly I tried using an unbound field and changing it via a form event,
but again I'm just getting a single variable for all the recordset.

What's the proper way? (I could just add a junk field to the table and use
it, but it doesn't seem right.)


No, no such thing as an updatable "temporary" field.

If you want to have a value associated with each record in a
table, then it has to be a field in the record (or a field
in another table that has a one to one relationship with the
original table).

I wouldn't call it a junk field, I'd call it a part of the
record's functionality.
 
What's the proper way? (I could just add a junk field to the table and use
it, but it doesn't seem right.)

Well, you have an arbitrary number of values, all of which can be
different. They've got to be stored SOMEWHERE! A Query is a dynamic
object, and (in Access) contains only the table fields (or
non-editable calculated fields) that make it up.

Either add the field, or create a second table in a one-to-one
relationship; use the same Primary Key and add this additional field.
Base your Form on a query joining this table by a Left Outer Join so
that you see all the data in your table, and NULL for the new field;
entering data into the new field will create a record for that ID.
 
Marshall Barton said:
No, no such thing as an updatable "temporary" field.

Not so! See google message ID:
<1067659397.218969@teuthos>

Not that I would suggest using that technique willy-nilly. But it >does<
work!

Cheers,
TC
 
Back
Top