Access - Records Value Check on Button Click

Posted on 2011-04-26
Last Modified: 2012-05-11
As one can see from my form - the user selects the items to be shipped with the checkbox on the left.

Trouble is now that if an item which goes to a different vendor is checked they all get shipped to the first vendor selected.

What I would like to have is a sort of safety measure which says that the last record (CC Vendor) is checked that it would pop up a Message Box mentioning that COATING and CC are different Vendors and asking for confirmation.

Every input is truly appreciated.

Thank You.
Question by:sktmx13
    LVL 119

    Expert Comment

    by:Rey Obrero
    post the codes that process the shipping of items.

    you should include in the codes to select the proper Vendor.

    Author Comment

    No Code really. The checkbox is a field inside the database which the user checks. On PrintPackingSlip or Purchase order I just run a query looking for a checked box and pipe it all into a report.

    Vendor is user chosen at this point. It's just a table having Vendor Abbreviations and Addresses.

    No magic here :) docmd.Requery and docmd.openreport is as deep as it gets .
    LVL 119

    Accepted Solution

    if all the controls in your form are bound to the table's field, you should not have any problem with items going to the wrong vendor.

    Author Comment

    Well, My image may be confusing there. Although the Part Numbers are the same they can in fact go to different Vendors. I just need to figure out if two or more vendors are picked to split them up or ask for confirmation upon clicking the Packing List or P.O.

    Author Comment

    I found the following snippet:
    Dim strSomething as string
    strSomething = ""
    While Forms!Mainform!Subform.Form.Recordset.EOF = False
       strSomething = StrSomething & NextRecordData
    Forms!Mainform!Subforms.Form.Recordset.MoveFirst 'this is just in case I want to use the recordset again while the form is open 
    Print #1, strSomething
    strSomething = ""

    Open in new window

    Now, I am thinking... if this guy was able to loop through his recordset can I loop through mine and look for a checked ToShip Box and then compare Vendors on each checked record with each other and throw an exception if there is more than one Vendor selected?

    Author Comment

    I implemented a ComboBox which sorts my form using a Filter and force people to select a Vendor prior to Printing.

    Not really what I was going for but it works for the time being until I can look into the books some more. :-/

    Author Closing Comment

    Problem was solved differently. Solution does not apply.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    This article describes some very basic things about SQL Server filegroups.
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
    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…

    760 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

    11 Experts available now in Live!

    Get 1:1 Help Now