Adding blank empty field to Continuous Form (1 Viewer)

smig

Registered User.
Local time
Today, 13:23
Joined
Nov 25, 2009
Messages
2,209
How do I add a blank empty field to all records on Continuous Form.
This field will be used to calculate another field, using the AfterUpdate event.

As I read here the only solution is to add the field to the table :(
Is it really?


Thanks
 

vba_php

Forum Troll
Local time
Today, 06:23
Joined
Oct 6, 2019
Messages
2,884
As I read here the only solution is to add the field to the table :(
Is it really?
of course it is, it you want a bound field. if it's not bound, why can't you just add a box via the GUI when in design mode of the form? and you're only adding a box to 1 record, the other boxes on the rest of the records appear automatically because it's continuous. it's the same box, repeated over and over again.
 

Ranman256

Well-known member
Local time
Today, 07:23
Joined
Apr 9, 2015
Messages
4,339
well if its a calculated field, then it will not be empty.
put the calculation in the query and this field will connect to that.
 

smig

Registered User.
Local time
Today, 13:23
Joined
Nov 25, 2009
Messages
2,209
of course it is, it you want a bound field. if it's not bound, why can't you just add a box via the GUI when in design mode of the form? and you're only adding a box to 1 record, the other boxes on the rest of the records appear automatically because it's continuous. it's the same box, repeated over and over again.
If it's not a bound box everything you put in it appear on all records. Not what I want.
 

smig

Registered User.
Local time
Today, 13:23
Joined
Nov 25, 2009
Messages
2,209
well if its a calculated field, then it will not be empty.
put the calculation in the query and this field will connect to that.
I know how to use Calculated fields.
It's not. I want to put data into it to calculate another field.
I don't need to save the data I put in, just do the calculation and save the result into another field.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 11:23
Joined
Jul 9, 2003
Messages
16,245
I want to put data into it to calculate another field.

I don't need to save the data I put in, just do the calculation and save the result into another field.

Have you tried a Query that calls a function? This way, there would be no need for an extra field.



Sent from Newbury UK
 

smig

Registered User.
Local time
Today, 13:23
Joined
Nov 25, 2009
Messages
2,209
Have you tried a Query that calls a function? This way, there would be no need for an extra field.



Sent from Newbury UK
What do you mean exactly?
If it's a calculated field I can't change it's value.
Even if I add it to the query as Exp1: field I can't change it's value.
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:23
Joined
Jan 23, 2006
Messages
15,364
smig,
Could you provide an example of the calculation and a little more info on where and when you need/want to display it?
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 11:23
Joined
Jul 9, 2003
Messages
16,245
What do you mean exactly


Ah! I read it as you wanted somewhere to store a temporary value.

How about you put a command button on the form, the form pops open an input box which you can put your value in, and then perform the calculation ?

Edit:- a command button will now be in each row .....


Sent from Newbury UK
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:23
Joined
Feb 28, 2001
Messages
27,001
If it's a calculated field I can't change it's value.
Even if I add it to the query as Exp1: field I can't change it's value.

But if you want to change a value that has any persistence whatsoever, AND want it to have potentially different values for different records, you HAVE to make it bound, in which case the problem is solved - just not necessarily to your liking.

You see, a form that shows records in continuous mode holds NO DATA for each record. It is just a display template. At most you could put one value in an unbound field in the template, but the continuous mode of display means that template is re-used for every record. There is ONLY ONE LINE in the template. If you put data in the template, the data will be reused for every record using the template.

By way of comparison: If the form was not set up as continuous, then it would have been set up as single-record style, and there it wouldn't matter that you are putting something in an unbound template field. The mode of the form wouldn't replicate that field to other records because it would only show one at a time.

If you want to change the value for one record with the implication that you would NOT change the value for a different record, you are forced into a narrow path. If that "only affect one record from the continuous group" is the behavior you wanted, the underlying field has to exist in the record to remember the difference.

The only other alternative is if the continuous form is actually a sub-form and you could put a value in an unbound text box on the parent form and have it be applied when you select a particular record. But there, if you are dealing with the AfterUpdate event, you are stuck with the fact that the AfterUpdate event would be on the parent and that would imply that focus is on the parent, so you would have to have something in the subform to remember that it was selected, which implies another (checkbox) field anyway.
 

smig

Registered User.
Local time
Today, 13:23
Joined
Nov 25, 2009
Messages
2,209
Thank you all for the help
I guess I have no real choice but having a field on the table, that I don't really need :(
All other alternatives will cause more problems, either for me or for the end users.

I think this case can be closed, so it will be marked as solved.
 

Users who are viewing this thread

Top Bottom