macro to set value in subform

T

TJones

This is a repeat cry for help (from forms)!

I have a "OrderForm" which contains "Item Buttons" where
a user can choose to add items to a subform
called "OrderDetails". "OrderDetails" is set to display
in Datasheet view. When you click on an "Item Button" it
should then (using a macro) 'set the value' of several of
the fields in the subform "OrderDetails". You should
then, in theory, be able to add as many items as you
would like onto the "OrderDetails" subform, however, I
can't get it to add past one. In other words, if I click
on an "item button" it will update the subform just as it
should.... however, if I click on another item button (so
I can add a second item), it
will just set the value of that same record in the
subform instead of adding another record.

I have "Allow additions" enabled and I am using the Table
itself as the Data Source, not a query. Is there a step
in the macro that I am missing? Is there a way to make
it automatically go to a new record?

Anyone have any ideas?? I'm desperate and out of time!

Thanks
TJones
..
 
S

Steve Schapel

TJones,

If you are using SetValue actions in your macro, these will apply to the
current record in the subform. You could put a GoToRecord/New action in
the appropriate place in the macro. However, I would not recommend
this. I think you would be better advised to set up an Append Query to
insert the new items into the subform's underlying table, and if you
like you can use an OpenQuery action on your macro to make this happen.
 

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