Results 1 to 13 of 13
  1. #1
    Join Date
    Oct 2003
    Posts
    15

    Unanswered: subforms requery problems

    OK,

    I have a combo box in a form which populates a subform.

    When a user wants to add a new quote, they click an add quote button in the form and it creates a blank record to fill in the subform.

    That works great.

    The data is written to the table in the backend just fine, and the new client name then appears in the combo box in the main form, but the data in the subform doesn't match the combo box company name.


    Once the form is closed and re-opened, the correct data is there.


    Is there a way to requery an entire subform to get it to read the live data, and not just the data at form open, or is there something else you'd recommend to alleviate this issue?



    Thanks all.
    Last edited by cmbehan; 10-24-03 at 20:02.

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Is your subform not linked to the master form using the Child Link and Master Link properties of the subform? That would keep everything on the same quote number.

  3. #3
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Do this:
    Forms![nameForms]![nameSubforms].Requery
    in the apropiate place.
    Saludos
    Norberto

  4. #4
    Join Date
    Oct 2003
    Posts
    15
    Originally posted by jmrSudbury
    Is your subform not linked to the master form using the Child Link and Master Link properties of the subform? That would keep everything on the same quote number.
    The subform is linked to the combo box using the master/child link, and it works fine for groups that existed in the table when the form was opened.

    but for new quotes I put in, the combo box IS requerying and picking up the company name, but it populates the subform with the incorrect data (actually, it uses the data from the lowest number record on file)



    When I close the form and re-open it, it has the correct data under the correct client name in the combo box.

  5. #5
    Join Date
    Oct 2003
    Posts
    15
    Originally posted by Norberto
    Do this:
    Forms![nameForms]![nameSubforms].Requery
    in the apropiate place.
    Thanks, but I'm a complete newbie.

    Where should I put this code?

  6. #6
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    I dont now how work the main form with the Subform, but i thing the place is where you send the focus to the subform.
    Saludos
    Norberto

  7. #7
    Join Date
    Oct 2003
    Posts
    15
    Originally posted by Norberto
    I dont now how work the main form with the Subform, but i thing the place is where you send the focus to the subform.
    I tried to insert the code in in the subforum got focus event, and got nothing.

    I also tried creating just a requery macro and attaching that to the subforum and many different events and got errors.


    Can anyone give me some advice?

  8. #8
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Send me an sample base in access 97 and then a see what is the problem.
    Them i send to you the base with the update.
    Ok.
    Saludos
    Norberto

  9. #9
    Join Date
    Oct 2003
    Posts
    15
    I have attached a zipped copy of a sample of what we're trying to do.

    In the database, there are three forms, Brokers, Salesman, and Quotes.


    We're mainly looking for the subform within the Quote Form to requery based on the most recent data represented in the combo box in the main form.



    Thanks!
    Attached Files Attached Files

  10. #10
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by cmbehan
    I have attached a zipped copy of a sample of what we're trying to do.

    In the database, there are three forms, Brokers, Salesman, and Quotes.


    We're mainly looking for the subform within the Quote Form to requery based on the most recent data represented in the combo box in the main form.



    Thanks!
    I found one interesting thing. When a new group was added it immediately was removed from the recordset of the subform. I right clicked and selected remove filter sort and everybody was there. Apparently it was filtered.

    Just a quick observation.

    Gregg

  11. #11
    Join Date
    Oct 2003
    Posts
    15
    Originally posted by basicmek
    I found one interesting thing. When a new group was added it immediately was removed from the recordset of the subform. I right clicked and selected remove filter sort and everybody was there. Apparently it was filtered.

    Just a quick observation.

    Gregg
    Thanks Gregg! That did alleviate one of the things I've been trouble shooting here.


    I'm still having problems with the subform requerying, though.


    Thanks all for any help or suggestions you can offer!

  12. #12
    Join Date
    Oct 2003
    Posts
    15
    just a bump to see if anyone else can help me with the subform requery issue I'm having....

  13. #13
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    I send your Sample Base with the Update.
    Attached Files Attached Files
    Saludos
    Norberto

Posting Permissions

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