Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Location
    New Kensington, PA
    Posts
    17

    Unanswered: Refreshing Unbound Controls (that contain calculations) on a subform?

    I have a main form with a subform (One to many relation) that calculates extended prices in a unbound textbox in the detail section of the subform. In the subform’s footer there are other unbound textboxes that perform other calculations. As you enter data on new line items the calculations work fine, however when pulling up previous records you have to tab thru all the input field to get the unbound controls to read and calculate the data. Is there a way to repopulate these unbound footer textboxes with out having to tab through all the fields in the subform’s detail area? Problem is my Visual Basic is very rusty! (Access 2000-2003)
    Last edited by LBorowiec; 11-13-06 at 11:42.

  2. #2
    Join Date
    Jul 2005
    Posts
    144

    Wink I hope this helps

    Quote Originally Posted by LBorowiec
    I have a main form with a subform (One to many relation) that calculates extended prices in a unbound textbox in the detail section of the subform. In the subform’s footer there are other unbound textboxes that perform other calculations. As you enter data on new line items the calculations work fine, however when pulling up previous records you have to tab thru all the input field to get the unbound controls to read and calculate the data. Is there a way to repopulate these unbound footer textboxes with out having to tab through all the fields in the subform’s detail area? Problem is my Visual Basic is very rusty! (Access 2000-2003)
    Hello LBorowiec,
    i am no expert here but what i understand is unbound controls can updated by requering the subform. so try this on the on current event of the subform

    private sub form_current ()
    [order details] . Requery 'order details is the name of the subform
    End Sub

    I hope this helps

  3. #3
    Join Date
    Oct 2006
    Location
    New Kensington, PA
    Posts
    17

    Suggestion Tried without luck

    I tried the requery method and that didn't recalculate the unbound controls that were calculated controls. I also created/used a query with the same results.

    private sub form_current ()
    [order details] . Requery 'order details is the name of the subform
    End Sub

    In this statement, I used [subform name].Requery as your example: [order details].Requery and I got an error message "variable not found". Where did I go wrong?

  4. #4
    Join Date
    Jul 2006
    Posts
    108
    try using that specific control
    ex:
    [order details].[textbox1].requery

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •