setting table field to calculated value on form-object required er

D

dfeigen115

On a form, I have several total value fields with a data source defined by
formulas (a running total of the various values entered in the form). As the
form is populated the running total fields are updating as expected.

When the user click the submit button, some additional edits are performed
after which I want to assign the calculated total to a field in the database
table. I'm currently using a statment formatted as

databasetable.fieldname = me.calculatedfieldname

I've verified the table & field names as correct, but I keep getting an
"object required" error when the code reaches the first of these statements.

Any suggestions will be appreviated, thanks in advance for you assistance.
 
M

Marshall Barton

dfeigen115 said:
On a form, I have several total value fields with a data source defined by
formulas (a running total of the various values entered in the form). As the
form is populated the running total fields are updating as expected.

When the user click the submit button, some additional edits are performed
after which I want to assign the calculated total to a field in the database
table. I'm currently using a statment formatted as

databasetable.fieldname = me.calculatedfieldname

I've verified the table & field names as correct, but I keep getting an
"object required" error when the code reaches the first of these statements.


To do that, you would have to go through the table object.
A form does not automatically make table objects accessible.
If the form is bound to that table and if that field is
included in the form's record source, then its fields are
included in the form's properties. So you could use:
Me.fieldname = Me.calculatedtextboxname
 
D

dfeigen115

Thanks Marshal, I'll give it a try.
Dan

Marshall Barton said:
To do that, you would have to go through the table object.
A form does not automatically make table objects accessible.
If the form is bound to that table and if that field is
included in the form's record source, then its fields are
included in the form's properties. So you could use:
Me.fieldname = Me.calculatedtextboxname
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top