I have a form based on a query which pulls from one table, and also has 2
unbound field that gatherd input from the user (qty).
I need to have the values from this form written to a table as a new record.
I have a button which is runs a macro:
Here is what the macro does:
OpenTable ||| TaskLineItems, Add
GoToRecord ||| new
setValue ||| [TaskLineItems]![ChargeCat], [Forms]![f_PullItems_2]!
[Category]
(repeat setValue for all fields)
But I get an error on this "The Object doesn't contain the Automation object
"TaskLineItems".
Can anyone help me with this.
Thanks!
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/200912/1
>Hi All,
>
>I have a form based on a query which pulls from one table, and also has 2
>unbound field that gatherd input from the user (qty).
An unbound field cannot "gather input". The data must be stored SOMEWHERE.
>I need to have the values from this form written to a table as a new record.
>I have a button which is runs a macro:
>
>Here is what the macro does:
> OpenTable ||| TaskLineItems, Add
> GoToRecord ||| new
> setValue ||| [TaskLineItems]![ChargeCat], [Forms]![f_PullItems_2]!
>[Category]
> (repeat setValue for all fields)
>
>But I get an error on this "The Object doesn't contain the Automation object
>"TaskLineItems".
>
>Can anyone help me with this.
>
>Thanks!
You will basically never need to or want to use the OpenTable action in a
macro. You're going about this the wrong way! What are your tables? How are
they related? What exactly are you trying to accomplish? Would a Form with a
Subform (based on the TaskLineItems table) perhaps meet your needs, without
any macros or code at all?
--
John W. Vinson [MVP]
John W. Vinson wrote:
>>Hi All,
>>
>>I have a form based on a query which pulls from one table, and also has 2
>>unbound field that gatherd input from the user (qty).
>
>An unbound field cannot "gather input". The data must be stored SOMEWHERE.
>
>>I need to have the values from this form written to a table as a new record.
>>I have a button which is runs a macro:
>[quoted text clipped - 12 lines]
>>
>>Thanks!
>
>You will basically never need to or want to use the OpenTable action in a
>macro. You're going about this the wrong way! What are your tables? How are
>they related? What exactly are you trying to accomplish? Would a Form with a
>Subform (based on the TaskLineItems table) perhaps meet your needs, without
>any macros or code at all?
--
John W. Vinson wrote:
>>Hi All,
>>
>>I have a form based on a query which pulls from one table, and also has 2
>>unbound field that gatherd input from the user (qty).
>
>An unbound field cannot "gather input". The data must be stored SOMEWHERE.
>
>>I need to have the values from this form written to a table as a new record.
>>I have a button which is runs a macro:
>[quoted text clipped - 12 lines]
>>
>>Thanks!
>
>You will basically never need to or want to use the OpenTable action in a
>macro. You're going about this the wrong way! What are your tables? How are
>they related? What exactly are you trying to accomplish? Would a Form with a
>Subform (based on the TaskLineItems table) perhaps meet your needs, without
>any macros or code at all?
--
The SetValue works on the form, not on a table, so don't bother opening the
table. Also in the SetValue, reference the field on the form (not in the
table). Do that for all fields, and that should work. Remember to save the
record on the form.
--
Daryl S
"granola911 via AccessMonster.com" wrote:
> .
>
Thanks again.
Daryl S wrote:
>Granola911 -
>
>The SetValue works on the form, not on a table, so don't bother opening the
>table. Also in the SetValue, reference the field on the form (not in the
>table). Do that for all fields, and that should work. Remember to save the
>record on the form.
>> Hi All,
>>
>[quoted text clipped - 17 lines]
>>
>> Thanks!
--
Message posted via http://www.accessmonster.com
>Thanks for the input... I was hoping not to have to create intermediate forms
>to get the values to the table, but that is what I've done. After trying
>everthing I was summizing that the setValue didn't apply to tables.
Having the macro run an Append query might be the simplest solution.