updating after update

kabir_hussein

Registered User.
Local time
Today, 03:33
Joined
Oct 17, 2003
Messages
191
Hi i have a form and a subform. the subform has prices and the then the main form shows the lowest price and totals that against a percentage increase to sell to customers.

what i have done is done a after update code on the subform but keep getting an error on the code.

here is the code im using

Me.Forms![Partnewadd]![Price] = Me.Forms![Partnewadd]![Text12]
Me.Forms![Partnewadd]![PriceToSell] = Me.Forms![Partnewadd]![Text72]


the bold text is what the VB highlights as wrong.

does anyone know what i am doing wrong

many thanks
 
Kabir, why not post the form so folks can have a look at it. I finally figured the "after update" thing on a subform myself recently.

Lol :D
 
kabir_hussein said:
what i have done is done a after update code on the subform but keep getting an error on the code.

Me.Forms![Partnewadd]![Price] = Me.Forms![Partnewadd]![Text12]
Me.Forms![Partnewadd]![PriceToSell] = Me.Forms![Partnewadd]![Text72]

if this code is on the subform, what form is that referring to? the parent or the child?
 
hi the subform is refering tot he parent form.

Sorry for the delay in replying.

here is a screen shot
 

Attachments

  • price.JPG
    price.JPG
    92.4 KB · Views: 124
Use:

Me.Parent.Price = Me.Parent.Text12

I'd advise you to change the textbox Price to txtPrice as, I'm guessing the field it's bound to is also called Price - this can confuse Access when two entities are named similarly.
 
Hi

thanks for the reply. Im not sure if i have explained my self properly. The price and price to sell on the main form should update it self once the subform has chosen the cheapest price. however this does not work. if i edit the pencentage increase field on the main form then tab it the price and price to sell update themselevs.

However i am trying to get the two fields to update themselves via the subform so if user just changes the subform the two fields in the main form will change.

I have attached the form i am trying to change.

you will notice two unknown text boxs on the main form. they are there because i could not find away of saving the data on to the price and price to sell fields any other way.

thank you
 

Attachments

Hi Kabir, had a quick look. Why not link the price filed on newadd directly to the min price box on newadd1 form footer, that's one link out of the chain. Then, why not put an expression behind newadd.price such that it auto updates the price to sell, i.e. Me![price to sell]=Me![price]*whatever calculation. Also I noticed that on your pricetosell textbox you have a expression as a validation rule. Should this not be in the default value fiueld?

Just a few thoughts, I'm not really an expert but these things I would do first.

Cheers, Lol
 
hi

many thanks for the reply, the reason i did not link the lowest price on to the price on the main form is because i have to change the control source and because the control source is changed. it does not save onto the table. The only way i have managed to get past this problem is to have another table which then updates it self to the main table.
 

Users who are viewing this thread

Back
Top Bottom