Results 1 to 12 of 12
  1. #1
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37

    Form behaviour for a new vs existing existing record

    Hello,



    With the forum's help I was able to set up a combobox with a SELECT and Auto Expand turned on to determine the existence of a record being added.

    I now realize that I need to take this a step further whereby, if the record exists then populate the field values on the form so additional subform items may be added. If it doesn't, the fields remain empty and can be populated.

    The purpose of this form is to add a new Family and records (-> Enrollment -> Student) related to it further down the relationship chain; and to bring up an existing family for which additional records (further down the relationship chain) may be added.

    Any guidance would be appreciated.

    Regards

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you use the ComboBox wizard to "Locate an existing record"?

  3. #3
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37
    Yes I did: is that all you needed to know?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does the form move to an existing record when one exists?

  5. #5
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37
    No. I used the combobox to store the ID of the record of interest into the record being assembled for the "record source".

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the form has an existing RecordSource then option #3 of the ComboBox wizard will let you move to the existing record.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Will this method *not* work for your situation? It sounds like it would to me.

  8. #8
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37
    I'll try it out; thanks for your help; I appreciate it.

  9. #9
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37
    Hello again,

    I tried what you suggested (i.e. Option 3 in combobox wizard) and it does work if you are after an existing record but not if you're wanting to create a new one. In my case I'd like to add and "enrolment" record either for an existing family or for a new family. Option 3 expects you to pick a value from the list.

    I'm thinking of creating 2 separate forms to accomplish this and let the user pick one or the other depending upon the situation. The other method would have been more slick by making the decision automatically.
    Thanks for your help.
    Regards,


  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Set LimitToList True and use the NotInList event to add the new record.

  11. #11
    Cedarguy is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    May 2012
    Posts
    37
    Thanks; I'll try it out; I am VB challenged so not sure what code to put in NotInList event.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about posting what the wizard put in the ComboBox event to look for the existing record? I think it can be easily modified to do what you want.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Overwrite on existing Record
    By waqas in forum Programming
    Replies: 8
    Last Post: 04-03-2012, 12:37 PM
  2. Add existing record to a subform help!
    By iarmereth in forum Forms
    Replies: 1
    Last Post: 03-29-2012, 06:01 PM
  3. Replies: 5
    Last Post: 03-02-2012, 08:58 PM
  4. Replies: 4
    Last Post: 05-30-2011, 08:20 PM
  5. Replies: 0
    Last Post: 02-25-2011, 09:40 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