Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282

    Subform won't requery

    Ok, so I have a subform which should update once something has been selected from a combo box elsewhere on the screen. (I'm pretty sure) I had it working, but then the combo box it relied on broke. Once I fixed that, I thought it would just go back to working as before... but it hasn't.



    The problem is on the "AddAssessmentRecord" form. The query the form is based on works, and pulled out the information I needed so I think there must be a problem in how it is transferring that onto the form or the requery of the form on update.

    The process to get to the form is as follows: search Liberi ID 54 in the appropriate search box on the homepage, click the search button, select the "Add New Assessment" button. Select "Distict4" and then "Team14" (in that order) in the appropriate boxes. Either Assessor in the assessor's name dropdown box should provide a response in the fields below (which are in the subform)

    Any and all suggestions are welcomed, thanks in advance
    Attached Files Attached Files

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Firstly - please put scroll bars on your forms! Not everyone has a 24 inch screen.

    Your instructions say "Add new Assessment" so there is nothing to display, the record hasn't been added yet. It won't be added either, your record source for the form doesn't allow records to be added. The way to check this is to run the query outside of the form and try and add records, that way you will know if your form will work or not.

    All that is happening on this form is that some combobox fields are being populated. Your subform is linked by ID but the ID doesn't exist. To check this make the ID field visible and see what is happening.

  3. #3
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Yes, sorry - I hadn't thought of that.

    Ok, I think I know what you're getting at... I was using a Select query, when it should be an append query (and not the record source)... right?

    If so, I have made the change, but the subform still isn't working. It's fine if I just open the subform separately - entering an Assessor ID pulls the information out - and the Assessor's Name combo box (called "Assessor" does have the AssessorID in the first field, so I think there must be a problem in the way the subform is finding the Assessor ID... but I see no problem in what I have done. I would upload pictures but I need to leave, so you'll have to make do with the database.
    Attached Files Attached Files

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This database doesn't work, following your instructions above I get and error when I click on Add Assessment, it is asking me for the Assessor id

  5. #5
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Quote Originally Posted by aytee111 View Post
    This database doesn't work, following your instructions above I get and error when I click on Add Assessment, it is asking me for the Assessor id
    Yes, that's the problem I'm having, I just don't know why it's happening - I can't see anything wrong with my code or the names of objects

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Go back to basics - what are you trying to accomplish. If you name a button "Add (a record)" then that record does not exist until you physically add it, so the data on that record is not accessible to you (the Assessor ID does not yet exist). How and where do you want to add it, what data do you want it to contain, etc. Only once that has been determined and the record has been added to the table can you display its data on your subform (or anywhere).

  7. #7
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Right, ok - I assume that means there is not a way to select the assessor on the form, before displaying their details below?

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Please tell us - are you trying to add a new record (in which case there are no details to display) or are you trying to display an existing assessor?

  9. #9
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I'm trying to display information on an existing assessor (once they have been selected using the dropdowns), and - when the user is sure everything is correct - add a new assessment to the tblAssessment table.

  10. #10
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    If I understand you correctly, you want to pull up an existing assessor record and create a new record based on the information from the existing one.

    Because the names of the objects (tables/queries/forms) are all so similar I am having trouble tracking the process. The button that says "Add Assessment" is actually adding an assessor, is that right? Very confusing. Be very careful with naming things, you may know exactly what is going on today but when you open this in a year's time you will have forgotten and it will help to have all things called by the same name - with "qry" or "tbl" and things like that to differentiate (as you have).
    e.g. click on "Add Assessment", display form "AssessorDetails" query "QryAssessorDetails" table "TblAssessor" - all of them should match with the table name

    Another thing that is adding complexity is using a query on a form as your record source instead of the table (when only one table is being referenced). There is no need for this and it adds an extra level to decipher.

    That said, before I continue with helping you thru this, please confirm that I have your process correct:
    - select a record from TblChild and display its details
    - click on Add Assessment which will find an existing assessor record and copy the information to a new record

    I can't see how you get from Child to Assessor. After displaying the information from TblChild you then go to adding an assessor, but which AssessorID do you want? There are many of them for that one ChildID.

  11. #11
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I want to assign an assessor to an assessment. The Assessors are already in the database from another form. The attached database does this, however I would also like information about the assessor (pulled from TblAssessor) to be displayed below the dropdown boxes, once the user has selected the assessor from them.
    Attached Files Attached Files

  12. #12
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Assessment Database (3).zip

    Open "Form1", see if it does something like you are trying to accomplish.

  13. #13
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    There isn't a "Form1" in the database you attached, are you sure you uploaded the correct file?
    Last edited by Heathey94; 09-23-2016 at 06:25 AM.

  14. #14
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Sorry! Here it is again.
    Attached Files Attached Files

  15. #15
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    No worries!

    I think Form 1 does something that I want... can I get the Assessor's Job Title, Organisation, Work Number etc. to appear in the same way you got the team and district to appear?

    Apologies for the duplication of child names - I just kept using the same data while trying to get it to work... I'll change them now.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Subform Requery
    By MTSPEER in forum Programming
    Replies: 15
    Last Post: 04-29-2015, 09:14 AM
  2. Subform Requery
    By MTSPEER in forum Forms
    Replies: 1
    Last Post: 03-12-2015, 08:20 AM
  3. requery subform
    By nswhit in forum Forms
    Replies: 2
    Last Post: 05-16-2013, 09:34 AM
  4. requery in subform
    By putte11 in forum Forms
    Replies: 7
    Last Post: 04-22-2013, 02:43 PM
  5. Replies: 3
    Last Post: 04-17-2012, 10:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums