Results 1 to 6 of 6

Thread: Subform Problem

  1. #1
    Join Date
    Oct 2006
    Posts
    17

    Unanswered: Subform Problem

    Hi guys,

    I have created a take - away database.

    In my main form i have 2 other subforms.

    1 which allows me to select the variety of different dishes and the other to calculate the bill.

    On the bill form i have created a button which is based on a macro which requeries in order to calculate the total price of the order. However, the problem i am experiencing is that when i create a new order, this subform disappears..?

    Any Ideas..

  2. #2
    Join Date
    Aug 2002
    Posts
    33
    Every time you open the form, set a Load event to make sure the subforms are visible. You can also set this on a button click.

    Private Sub Form_Load()
    Me.Subform1.Visible = True
    Me.Subform2.Visible = True
    End Sub

    If that doesn't work load the subform source object on load event as well.

    Private Sub Form_Load()
    Me.Subform1.SourceObject = "frmsubform1"
    Me.Subform2.SourceObject = "frmsubform2"
    Me.Subform1.Visible = True
    Me.Subform2.Visible = True
    End Sub

  3. #3
    Join Date
    Oct 2006
    Posts
    17
    Either method don't work =/.. the subfrm can be seen if the order is already processed. However, for a new order the subfrm cannot be seen since there is no order. And i cannot calculate the total price since my calculate button is within the hidden form.

    When trying to create a button in my main frm requerying the field in the hidden subfrm it won't process. Error message is experienced

    "cannot find specified field" =/.

    Hope this makes helps.

  4. #4
    Join Date
    Aug 2002
    Posts
    33
    When creating a new order, make sure you add a new record first, then requery the subforms so they display. Either that, or you can use the datasheet mode, but the caculate will not caculate unless there are records.

  5. #5
    Join Date
    Oct 2006
    Posts
    17
    I understand that i must enter the record first, but i cannot re-query the form, since the button is within the hidden form. When trying to re-query the form from my main form by assigning a macro, it displays a message "cannot find current field." Also when using the datasheet view my buttons cannot be displayed.

  6. #6
    Join Date
    Sep 2006
    Posts
    265
    Never put Actions on subforms that are dependancies. This is how I would address the problem

    Save the Parent Record ensuring the the record is written away
    On the Parent Form - Requery the Name of the subform(s) (Properties information of the Subform).
    Then address the fields you wish to 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
  •