Results 1 to 6 of 6
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317

    Automatically creating new record in related table


    Please see the input form in the attached database. If I enter "Yellow" in Field2 where Field1 contains "Lemons", it's accepted, because "Yellow" appears in Table2. But if I enter "Red" in Field2 where Field1 contains "Strawberries", it's rejected, because "Red" doesn't appear in Table2.

    What's the most efficient way of getting a new record created in Table2 as soon as "Red" has been entered in Field2 of the form? Or have I structured the whole thing incorrectly?
    Attached Files Attached Files

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,412
    See the above. Using split form (just as example) as continuous form will not work for this situation.

  3. #3
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Thanks for your suggestion. However, I can't see that it helps. Unless "Red" is already in tblColors, the message "The text you entered isn't an item in the list" appears when "Red" is typed in Color (i.e. the form field). What I'm looking for is the most efficient way of getting "Red" into tblColors as soon as it has been typed in Color, if it's not already there. I assume the Not In List event is an option, but I don't know whether it's the best one.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That is the best option I think. Search here for "notinlist" and you should find two basic methods, one just adding the value and the other popping up a form to add other required info in the other table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Many thanks. I'll go with the first option. I've used the Not In List event before but had forgotten it when I started the thread (largely because I wasn't using combo boxes). I was also unsure whether I'd just misconceived the issue.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 08-24-2017, 09:03 PM
  2. Replies: 1
    Last Post: 06-06-2016, 06:05 PM
  3. Replies: 2
    Last Post: 08-07-2014, 07:31 AM
  4. Replies: 5
    Last Post: 12-19-2012, 07:26 PM
  5. Replies: 7
    Last Post: 07-02-2012, 10:50 PM

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