Page 3 of 6 FirstFirst 123456 LastLast
Results 31 to 45 of 84
  1. #31
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I had that new form working without needing to add any lines of code. That suggestion was a long time ago and I am sure I was referring to something else.



    Please run my form as I set it up, it was working correctly. See if it is doing what you want it to do before making any changes.

  2. #32
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I am - I have made no changes to your database, but when I am on the ChildRecord form and click the Add New Assessment button (or just open the AddNewAssessment form), I get the error box shown in post 30

  3. #33
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure why that is happening to you. I haven't touched that form and it has been working fine for me. Did you make any changes to it? Send me your database, it must be different to the last one I sent you.

  4. #34
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    I just used the one you uploaded to the site in post 27 (and re downloaded it a second ago to make sure), but here it is anyway.
    Attached Files Attached Files

  5. #35
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Ignore that. I was only using a read only copy, that's why, isn't it?

  6. #36
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Phew! That's exactly why. Let's move on to the next issue!

  7. #37
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    OK, so I got past that issue, onto the AddLowRiskAssessment form and tried to double click on something from the list box, this came up:
    Click image for larger version. 

Name:	ListBoxVBA2.PNG 
Views:	16 
Size:	24.6 KB 
ID:	25945
    when I debug and hover over the highlighted text, I get the feeling that the problem is probably the AssessmentID
    Click image for larger version. 

Name:	ListBoxVBA2Debug.jpg 
Views:	16 
Size:	29.1 KB 
ID:	25946
    when I hover over the other section, BehaviourDescription=12

  8. #38
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    When the form is opened the AssID is displayed at the top. This form is opened using the AssID from the previous form.

    "DoCmd.OpenForm "AT_AddLowRiskAssessment", , , "AssessmentID=" & Me!AssessmentID"

    It comes from the previous form, check that it is there on both forms, check that you added the record to the table,

  9. #39
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    On the version you uploaded, the AssessmentID does not pull through from the AddAssessmentRecord page - that field just says (New)

  10. #40
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Go into design mode on the AddAssessmentRecord form, go to the vba code for "Next Page" - does it show what I typed above? Or is there another way to open the low risk form that I missed?

  11. #41
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Yes, I can't see any difference between the two codes, and there is another way... but I haven't got to it yet - and is not the cause of the problem as I haven't opened this form - (eventually it will be the Previous page button on the AddMediumRiskAssessment form - this might not be necessary information now, but I was unsure if it would affect the way we do anything here)

    I've just checked, and the information is definitely saving to the table.

  12. #42
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This is what my form is showing - see the AssID "28" at the top, don't know why yours is null

    Click image for larger version. 

Name:	Untitled.png 
Views:	11 
Size:	143.7 KB 
ID:	25947

  13. #43
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Me either. But my version does pull the assessor ID through, so we could try to ignore that?

    How did you connect your list box to the subform? I can't seem to find it.

    Also, is there a reason it has to be a listbox instead of a combo box?

  14. #44
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The form I sent you doesn't use the assessor ID - ???

    The subform is linked to the main form by AssessmentID, the behaviour has nothing to do with anything. The reason this is done is so that when the form is opened the subform will show all records that belong to that AssID as well as when you add a new record it will put the correct AssID on to the table. When you have a min form/subform setup it mimics the realationships on the tables. TblAssessmentDetails is not linked thru the behaviourID, that would be a different form showing all TblAssessmentDetails records for a certain behaviour, which is not what you are doing here.

    The listbox is an add-on, a "nicety". Remove it and the form will behave no differently. If they want to select a behaviour they can either double-click the listbox or else select form the combobox - don't need two comboboxes.

  15. #45
    Heathey94 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2015
    Location
    United Kingdom
    Posts
    282
    Sorry, I meant Assessment.

    Yes, I realised that as you responded - my query was because I have copied what you have done onto my database, but the BehaviourDescription combo box is not receiving this information - so I've obviously missed something. (Also, it asks if I want to append the row when I double click on the behaviour, which I assume we can get it to do automatically?).

Page 3 of 6 FirstFirst 123456 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-01-2016, 04:06 PM
  2. Replies: 1
    Last Post: 12-20-2015, 01:09 PM
  3. Replies: 4
    Last Post: 07-14-2015, 06:49 PM
  4. Replies: 2
    Last Post: 05-28-2013, 04:00 PM
  5. Sub form based on table select specific records
    By ReluctantGeek in forum Forms
    Replies: 0
    Last Post: 01-21-2012, 11:24 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