Results 1 to 2 of 2
  1. #1
    Tvanduzee is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    39

    Variable markup calculation

    Hello



    I have a form/subform.
    I placed an textbox in my subform with a default value of [Cost] * .40
    I did this because I want the value to default to this calculation, but give the user the ability to put in a different value if needed. But when I change the value on one row, all the rows change to the same value.

    I tried adding a field to query for "Markup" with the calculation [Cost] * .40, but it would not allow me to change the value in the form.

    Any suggestions?

    Thank you
    Terry

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    You again!

    Presumably your textbox is unbound. Yes, this is what happens for unbound controls on a continuous form: it's the same for everybody. So how do we solve it?

    One way is to include another column on the underlying table. In this manner each line/record has a 'unique' value.

    Another way is to place the textbox 'away' from the continuous form, say in the footer area of the composite form (or even in the main form itself). However this leads to some complication in synchronising the value shown and current record of the continuous form. The Form_Current event (listed as On Current) is the event best suited for this purpose. So, how to refer to the textbox, now in the footer of the main form, from within the continuous sub form. If you have set things up conventionally then you may write: Me.Parent.MyTextbox.

    Again, I've only hinted at solutions so if you get stuck, get back to us.

    PS You can of course add a footer to the continuous form if it has not got one already and this overcomes addressing complexities between forms.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 04-03-2012, 06:31 AM
  2. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  3. Object variable or With block variable not set
    By walter189 in forum Programming
    Replies: 1
    Last Post: 07-28-2011, 08:51 AM
  4. Replies: 4
    Last Post: 08-05-2010, 01:26 PM
  5. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums