Access 2003 not in list event...

Posted on 2009-04-20
Last Modified: 2012-05-06
I have an Access 2003 database which has a tblContact and a tblVehicle. On my form "Contacts" if someone tries to put in a vehicle NOT IN LIST, I have an event that tells them the item in not in the list, do they want to add it, and if they say YES, it opens up the vehicle data entry form  "vehicles" (see code below). They enter the new vehicle information, save it and it pops them back in the Contacts form populating the field. All this works great.

My question is this...when the new vehilce is being entered on the vehicle entry form, I wanted to put previous and next buttons so the user could scroll through all the entries in the tblVehicle as well as correct data entry errors from prior entries. This keeps the users out of the database. Problem is, I cannot scroll to anything from this form "vehicles" Is it possible? If so, how? I don't want to have to build another form just to allow maintenace on tblVehicles.
thx experts....Bob

Dim MsgStr As String


MsgStr = "'" & NewData & "' is not setup as a Vehicle. Do you want to add it?"


If vbYes = MsgBox(MsgStr, vbYesNo + vbQuestion, "New Vehicle?") Then

    DoCmd.OpenForm "vehicles", acNormal, , , acFormAdd, acDialog

    Response = acDataErrAdded


    Response = acDataErrDisplay

End If

Open in new window

Question by:bobrossi56
    LVL 75

    Accepted Solution

    Why not just open the exact form from a menu ... to do the maintenance.   But open it in normal view will all records, with maybe Allow Additions set to No.

    Not sure I would want to overly complicated the Not In List function - which you already have working - and in addition to 'not in list addition' ... also ... at the same time, to allow for correcting other items in the list.


    Author Comment

    OK, that would work mx, but being a novice as yo know I am, how would I add said form to a menu?
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    The easy way to create custom Windows menus (standard) with no code:

    Everything you need is here ... see this link:
    Not sure it that article mentions it, but ... when you are in the Customize mode (dialog) ... if you hold down the Control key, you can drop and drag (ie, copy) menu items from one place to another ... handy for making a new menu that is similar another one.

    Here is a related link also:

    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    I've created 100's and 100's of menus using this technique ... very cool.


    Author Closing Comment

    Once again, mx doesn't disappoint.
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    "Grade:  A - "Once again, mx doesn't disappoint."  "

    Really Bob ... once you get the hang of creating custom menus ... you can say 'GoodBye' to the Access switch board - basically.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now