Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by AndyRob1973 View Post
    Thanks again Bob - yes i would be interested in that alternative approach - the more options and learning the better!
    In the attached db you can add to the list of studies by typing the new study name into the combo box(cmbFind). See the code i the "Not On List" event of the combo box. Post back if you have any questions
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  2. #17
    AndyRob1973 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2020
    Posts
    81
    Quote Originally Posted by Bob Fitz View Post
    Alternatively, you could use the following line the "After Update" event of the form called "frmStudies".

    Forms!frmMF_StudyRecruits.cmbFind.Requery


    FWIW my personal preference would be to NOT have a button to open "frmStudies" but use the "Not On List" event of the "cmbFind" combo box to open "frmStudies". Let me know if you'd like to try that approach instead.
    I think I will use the "Not in List" method but I'm curious as to why the code below doesn't seem to work in "After Update" event of the form called "frmStudies".

    Forms!frmMF_StudyRecruits.cmbFind.Requery

    The new study appears and i can select it but it doesn't update the boxes below (ie IRAS, StudyName and LeadNurse, or the frmEnrolments) until i close the forms and reopen. Could you help?

    Much appreciated Bob

  3. #18
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by AndyRob1973 View Post
    I think I will use the "Not in List" method but I'm curious as to why the code below doesn't seem to work in "After Update" event of the form called "frmStudies".

    Forms!frmMF_StudyRecruits.cmbFind.Requery

    The new study appears and i can select it but it doesn't update the boxes below (ie IRAS, StudyName and LeadNurse, or the frmEnrolments) until i close the forms and reopen. Could you help?

    Much appreciated Bob
    When I said earlier that I would prefer to use the Not On List event of the combo box I hadn't understood anything of what your db was about or how it was working. I hadn't realized for example that the combo was being used to find a record rather than for data entry. Nor had I realized that the form with the combo is bound the same data table as the form you were opening to create a new entry. I don't understand why you would use a second form when you could just go to a new record in the first form.

    I would usually use the Not On List event to create a new record when that combo is used for data entry. For example, when you want to add a new product to the list while creating a detail line on an invoice.

    However, after saying all that, the attached db does allow you to create a new "Study" in the combo box after which the code moves the focus to that record.
    Post back if you have any further questions.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #19
    AndyRob1973 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2020
    Posts
    81
    Quote Originally Posted by Bob Fitz View Post
    When I said earlier that I would prefer to use the Not On List event of the combo box I hadn't understood anything of what your db was about or how it was working. I hadn't realized for example that the combo was being used to find a record rather than for data entry. Nor had I realized that the form with the combo is bound the same data table as the form you were opening to create a new entry. I don't understand why you would use a second form when you could just go to a new record in the first form.

    I would usually use the Not On List event to create a new record when that combo is used for data entry. For example, when you want to add a new product to the list while creating a detail line on an invoice.

    However, after saying all that, the attached db does allow you to create a new "Study" in the combo box after which the code moves the focus to that record.
    Post back if you have any further questions.
    Hi Bob

    Thankyou for your three replies.

    I'll have a good look at them.

    Andy

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Relatively simple relationship question
    By Rendon115 in forum Access
    Replies: 2
    Last Post: 05-21-2020, 05:27 PM
  2. Data Input Many to Many relationship
    By sharkey_lsu in forum Database Design
    Replies: 5
    Last Post: 02-10-2015, 06:30 PM
  3. Establishing a simple relationship?
    By Harry2 in forum Access
    Replies: 7
    Last Post: 06-16-2014, 02:41 PM
  4. Replies: 3
    Last Post: 01-24-2014, 10:45 AM
  5. Simple input mask
    By BPB6 in forum Access
    Replies: 8
    Last Post: 10-18-2012, 06:34 AM

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