rehash of previous question- adding items to listbox and then to database

Posted on 2011-05-05
Last Modified: 2012-05-11
open database- a form comes up-
1.enter service no. ( hit enter or tab) name from dropdown box ( hit enter or tab)
3.enter part number into listbox- select items from drop down( and hit enter)
4. click command button to enter data into database.
I just changed command in click event  cmdAddtoDatabase_Cllick()
from Do Until x = Me.lstIds.ListCount
to Do Until x = Me.LstIds.ListCount-1
and thought that fixed - now am using it and not working
any more suggestions- thank you
Question by:davetough
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    So, what exactly is not working ?


    Author Comment

    when you enter multiple serial numbers - it still inputes into the database and incorrect number of records- more than you enter- thank you
    LVL 75

    Accepted Solution

    ok ... see if this works


    Author Closing Comment

    thanks- great - works now
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    You are welcome.

    Do you see what I change.
    The Do/Loop wasn't necessary ...

    For/Next ...


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 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

    15 Experts available now in Live!

    Get 1:1 Help Now