Access set value macro

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

Guest

I use an order form with a subform to list order details, quantities, product codes, cost, etc. I need to assign the same Order ID and Purchase Order number to the subform as is on the main order form. I feel the set value macro should do this, but I must be missing a step. When I enter an order, or change an order amount, I get an error message that the macro failed. I attached the macro to the order details subform, order quantity field

I will appreciate any suggestions.
 
Hi Bobby!

I don´t know anything of your aplication but somehow I have a fieling that
you´r having problem with the basic relationship, or?

If the main form bound to a table or query and the subform is bound to also
a table or query with a ONE to MANY relationship between these two
recordsources then should this problem that you´r describing never happen.
As long as you set the linking correct between these two form´s.

I´ll try to explain:
The easyest explanation I can think of is two tables (tblMain and tblSub)
relationed to each other like this:

tblMain...............................tblSub
MainID (ONE---MANY) fkMainID
FieldWhatEver..................SubID
FieldWhatEver..................FieldWhatEver

Here is field [MainID] autonumber and [fkMainID] is of long type or integer
and the both tables have a relation of ONE to MANY between each other.

If I create a mainform which have tblMain as a recordsource and a subform
which have tblSub as recordsource I just have to use the wizard when I add
the subform to the mainform and it´will do the work for me.

If I want to do it myself I have to set propertie "Link from" = MainID and
"Link to" = fkMainID.

When I add or edit a record in my subform it will "automaticly be linked to
the field [MainID] in table tblMain.

Maby this is´nt your problem but from my point of view (not beeing an
expert) it seams as if this might be your problem.

// Niklas


Bobby said:
I use an order form with a subform to list order details, quantities,
product codes, cost, etc. I need to assign the same Order ID and Purchase
Order number to the subform as is on the main order form. I feel the set
value macro should do this, but I must be missing a step. When I enter an
order, or change an order amount, I get an error message that the macro
failed. I attached the macro to the order details subform, order quantity
field.
 
Back
Top