How to make a subform's field clear on open

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fspinelli
    New Member
    • Aug 2010
    • 85

    How to make a subform's field clear on open

    Hi again!

    I have a form (parent) that has a subform (child). I know how to make it so the parent form's feilds opens up null, but I need the subform (child) to open up null, too, when this form opens up.

    From the parent form the subform populates symbols based on the parent form which has some combo boxes to choose from and one text box to enter a number into. When the end user enters or choses the data in the parent form a query makes symbols out of that data in the subform.

    I don't know how to make the subform clear out on open.

    Whilst in the subform I clicked on it and On Open I placed code:

    me.bbl = null

    but that didn't work (bbl is a field name)

    and I tried in the parent form

    me.subformname. requery

    didn't work

    and I even tried in the parent form

    me.subformname. bbl = null

    It didn't work either, but I really don't know if that's a real code, but I tried it.

    In a nutshell I need the parent and the child fields on open to be clear (null). The child (subform) is a query.

    Suggestions?

    thank you very much!
    Faith
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Can you not simply set teh subform to Date Entry only? It depends on what your requirements are and you have not described that accurately.

    Also you should not use field names in code, but control names. So say bbl is the field in the table, and you have a control bound to that field, you name the control: txt_bbl (if its a textbox) and use that in code:
    Code:
    me.txt_bbl=Null

    Comment

    • Fspinelli
      New Member
      • Aug 2010
      • 85

      #3
      Thank you.

      Comment

      Working...