Calculated Fields in New records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form called "DefaultPayments" inside of it I have a subform called
"payments." The "payment subform has calculated fieds in order to keep track
of incoming monies. I would like for "payments" to open to a new form. I
tried a maco for the "on open" event, and I get an error that tells me that
the form isn't open. So I tried to alow only new records in the properties,
but then my calculated fields won't work. I am stumped can anyone give me any
ideas?

Thank you
 
Sarah,

If you don't need to see previous subform records, then set the Data
Entry property of the form which you are using as the subform, to Yes.

Otherwise, you will need your macro to set the focus to the subform
control before trying to select a new record. Something like this...
Action: GoToControl
Control Name: [YourSubform]
Action: GoToRecord
Object Type: <blank>
Object Name: <blank>
Record: New

Assign this macro on the On Open event property or the On Load event
property of the DefaultPayments form.
 
Steve

Thank you for your sugestions. I don't need to see the previous enteries but
setting the "data entry" property to yes sets my calculated fields to errror.
So in trying the macro I still get the error that says "Payments subform
isn't open". Do you have any other sugestions?
 
Hi Sara,

Can you please post back with fulldetails of the macro that is resulting
in this error message? All macro actions in the macro, with all
applicable argument settings, and the event the macro is assigned to.
Thanks. There must be a misunderstanding.
 
Sure:

Action1 : GoToControl>>Control Name: Payments Subform
Action2 : GoToRecord>> Object Type: Form, Object Name: Payments Subform,
Record: New. Offset:

Open event

Error message
The object 'Payments subform' isn't open.
*The macro you are running (directly or indirectly) contains a GoToRecord,
RepaintObject, or SelectObject action, but the Object Name argument names an
object that is closed.
*The objectname argument for the GoToRecord, RepaintObject, or SelectObject
method names an object that is closed.
Use one of the Open actions or methods to open the objectso that you can
carry out the desired action.

I tried to put an open event at the begining of the macro but then it opens
the subform as it's own form.
 
Sarah,

I take it this macro is on the Open event of the main form?

As I mentioned before, the Object Type and Object Name arguments of the
GoToRecord action in the macro should be left blank. Try it like that.
 
Yep you were right I missunderstood you.
I fixed that and the form load like a charm, almost.
There are no errors but my calculated fields don't work. I realize that it
is because they are set up to add the previous records, and with the macro it
thinks that there are no previous records. So do you know how to fix this?

Thank you so much
 
Sorry Just kidding!
I still had the date entry property set to "yes".

Both forms are perfect!
Thank you so much for you help.
 
Back
Top