PC Review


Reply
Thread Tools Rate Thread

Conditional update of main form from subform

 
 
kagard@gmail.com
Guest
Posts: n/a
 
      7th Dec 2006
Greetings:

I have created a purchase order form and subform. As you would expect,
the main form shows the PO data, and the subform shows the individual
items on the PO. I calculate the subtotal in a text box in the subform
footer. This works fine. However, we sometimes ignore the line item
prices and type a total in the PO Total text box on the main form.

I have written an after update event procedure in the subform that
looks at the main form to see if the Use Lump Sum Total checkbox is
checked. If it is, the PO Total textbox on the main form is not
updated. If it is not, the PO Total textbox is updated with the revised
total.

HERE'S THE PROBLEM: The PO Total on the main form is updated before the
subtotal on the subform, so the number placed on the main form is the
value before the edits on the subform. The old value is set, then
Access, lastly, updates the value of the calculated field on the
subform.

I have tried:

1. Setting focus on the main form, then the subform, and back to main
form in hopes of getting the subform subtotal to recalculate.

2. Tried doing a requery, repaint, or recalculate of the subform.
(Which, oddly, yeilds 0 on the main form, then displays the correct
total on the subform.)

Any suggestions? TIA...

Keith

 
Reply With Quote
 
 
 
 
kagard@gmail.com
Guest
Posts: n/a
 
      7th Dec 2006
Thanks for the reply.

In the POs we are sending out, we need to list and store the retail
prices. Entering a lot price at the detail level, while retaining the
individual unit and extended prices sounds like it would get messy
trying to do the calculations.

And, more to the point, my boss has specifically requested the current
layout...

Thanks again,

K


Sprinks wrote:
> Kagard,
>
> Although this would require some disassembly and reconfiguration of your
> form, I think this would be handled more cleanly by entering the line items
> as normal, then, if you want to offer the customer some lot price deal, enter
> a line item titled "Lot Price", quantity one, and enter the value--better
> yet, press a LotPrice command button that would enter the LotPrice line item,
> set the focus to the Amount field, and zero the unit prices of the other line
> items.
>
> Sprinks
>
>
> "(E-Mail Removed)" wrote:
>
> > Greetings:
> >
> > I have created a purchase order form and subform. As you would expect,
> > the main form shows the PO data, and the subform shows the individual
> > items on the PO. I calculate the subtotal in a text box in the subform
> > footer. This works fine. However, we sometimes ignore the line item
> > prices and type a total in the PO Total text box on the main form.
> >
> > I have written an after update event procedure in the subform that
> > looks at the main form to see if the Use Lump Sum Total checkbox is
> > checked. If it is, the PO Total textbox on the main form is not
> > updated. If it is not, the PO Total textbox is updated with the revised
> > total.
> >
> > HERE'S THE PROBLEM: The PO Total on the main form is updated before the
> > subtotal on the subform, so the number placed on the main form is the
> > value before the edits on the subform. The old value is set, then
> > Access, lastly, updates the value of the calculated field on the
> > subform.
> >
> > I have tried:
> >
> > 1. Setting focus on the main form, then the subform, and back to main
> > form in hopes of getting the subform subtotal to recalculate.
> >
> > 2. Tried doing a requery, repaint, or recalculate of the subform.
> > (Which, oddly, yeilds 0 on the main form, then displays the correct
> > total on the subform.)
> >
> > Any suggestions? TIA...
> >
> > Keith
> >
> >


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery main form after subform update and not lose place in main form. Michael Microsoft Access Form Coding 1 23rd Nov 2010 09:26 PM
Update subform from Main form =?Utf-8?B?TWlrZQ==?= Microsoft Access Form Coding 8 4th Nov 2007 04:40 PM
Update Main Form Using Subform YankeesFan@tokeer.port5.com Microsoft Access Form Coding 1 27th Sep 2007 05:07 PM
Update value on the main form with the value on a subform =?Utf-8?B?QnJhbmRvbg==?= Microsoft Access 0 8th Nov 2004 03:24 PM
update subform from main form DeVille Microsoft Access Forms 1 31st Oct 2003 05:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 PM.