Results 1 to 5 of 5
  • Thread Tools
  1. Star Lounger
    Join Date
    Oct 2003
    Location
    Nashville, Tennessee, USA
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add New Record (Access 97)

    I know there has to be an "easy" way to do this....

    There is a form (Service Parts and Volumes) thats control source it the table (MainTable). With the field (Part Number) being the primary key. The form allows the user to select a part number then that part numbers information is displayed to be updated. However, I need to allow the user to "Add" a part and its information if it is not currently in (MainTable). So far I have the combo box (Part Number) as unbound. And the following in the "Not In List" Event:
    MsgBox "Add Part " & [part number] & "", vbYesNo, "Part Number Not On File"

    Here is where I become stuck....
    First off, the "Add Part" &[part number]&"" does not display what they have typed.
    Secondly, is there away to code it so that if the user clicks the "Yes" button, the part number is added and it returns them to the form so that they may fill in its needed information?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Re: Add New Record (Access 97)

    See these recent threads for examples of how to use the Not In List event: <post#=314095>post 314095</post#> and <post#=313851>post 313851</post#>.

  4. Star Lounger
    Join Date
    Oct 2003
    Location
    Nashville, Tennessee, USA
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add New Record (Access 97)

    I looked at and Applied your idea in post 313851. However, once the new item is added, how do it get it so that the other fields will be cleared out to allow new information.
    Currently when the form opens, there is already data in the 6 other bound fields in the form. When the part number is choosen, the bound fields change to the correct information. However, when a new part is added, it does not change to blank fields. Any suggestions?

  5. Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,468
    Thanks
    2
    Thanked 39 Times in 39 Posts

    Re: Add New Record (Access 97)

    Are you using the combo box to navigate on a form, and one that was built by using the wizard? In that case the combo box is not bound to a field, so until you add the new record the form is still looking at the old record. In general, a different method, typically using the record navigation controls or buttons and code is typically used to add a record. There are also some serious issues with combo boxes that have to have a rowsource of 10s or 100s of thousands of records - there is a current thread on that topic.

    BTW, we usually try to keep topics in a single thread, and this appears to be sort of a expansion of <post#=314949>post 314949</post#> where you asked a similar question.
    Wendell

  6. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Re: Add New Record (Access 97)

    You asked essentially the same question in <post#=314949>post 314949</post#>. To avoid duplication and confusion, I am locking this thread. Replies in the other thread, please. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •