Form User Input Field to Table (1 Viewer)

Virginia

Registered User.
Local time
Today, 21:57
Joined
Nov 16, 2000
Messages
10
I'm trying to transfer a calculated sum from a form to a table. User is to enter amount on Field A and Field B and the calculated sum on Field C is to be transferred to a table (to SumField). I have created a SetValue macro with the following properties:

Item: [MyDatabase]![SumField]
Expression: [Forms]![MyForm]![Field C]

------------------------------------------------

However, when I try to run this macro, I get the following error:

Microsoft Access can't find the form 'My Form' referred to in a macro expression or Visual Basic code.

* The form you referenced may be closed or may not exist in this database.
* Microsoft Access may have encountered a compile error in a Visual Basic module for the form.

-------------------------------------------------

I have not entered an equal sign before the expression.

Both my form and my database are open when I run the macro (must they be?)
 

ntp

Registered User.
Local time
Today, 21:57
Joined
Jan 7, 2001
Messages
74
Check to make sure you typed the name of the form correctly ([MyForm] and not 'My Form') as you have it different in your question.

As to the form/database having to be open, the form must be loaded if you want to access a control in it. It does not have to visible or anything, just loaded. The database does not have to be open. You can create a database object and access other objects from that database wothout it being open.

ntp
 

Users who are viewing this thread

Top Bottom