Field not Updating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rwalle
    New Member
    • Jan 2010
    • 47

    #1

    Field not Updating

    I have a search form(BusquedaPr od) with several text boxes and Combo boxes to search products within a subform(SubForm RawProducts) inside it; its working fine, the subform has following field:
    ProdId(AutoNum, PK),
    ManId(Number,FK )
    ManPartNo(Text)
    ProdDesc(Text)
    The manufacturer(Ma nId) is a Combobox where you pick the manuacturer to assign to a product, but some times you have to add a Manufacturer that is no in the list, so DoubleClick the ManId Field the AddManForm opens and you can Add new Manufacturer data.
    In the AddManForm Close event I wrote some code to requery the [ManId] ComboBox inside the SubFormRawProdu cts, but Im confusing about how is the right way to point to the [ManId]Field in the sub form.
    I have the following code but nothing happens, no error showed up but also the ManId Field doesn't refresh

    Code:
    Private Sub Form_Close()
    If (IsLoaded("SubformRawProducts")) Then
    Forms!BusquedaProd!SubformRawProducts!ManId.Requery
    End If
    
    End Sub
    any help will be apreciated

    Thanks
    Raymundo Walle
  • evildracko
    New Member
    • Jul 2010
    • 14

    #2
    try a macro on the form close the [...] macro buiilder

    then use requery and specify this field without the if

    just an idea hope it helps

    Comment

    • Stewart Ross
      Recognized Expert Moderator Specialist
      • Feb 2008
      • 2545

      #3
      Hi. We have an Insights article on referring to items on a subform which can help you on the correct syntax for such control references.

      Line 3 in post 1 is missing the .Form part of the reference to the subform:

      Code:
      Forms!BusquedaProd!SubformRawProducts.Form!ManId.Requery
      -Stewart

      Comment

      • Jerry Maiapu
        Contributor
        • Feb 2010
        • 259

        #4
        I do not know but try: It works for simailar scenerios.

        Code:
        Docmd.Requery "SubformRawProducts"


        Simply refreshes the sub form

        Comment

        Working...