Results 1 to 2 of 2
  1. #1
    donnie.atchison is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jul 2018
    Posts
    12

    How do I us VBA for a form to find ra field in a record using a combo box.

    I have a Transportation tracking data base. The database is used for transportation GPS tracking. Each record is a shipment, Each shipment has multiple GPS trackers on the shipment. When the GPS tracker gets to its destination the tracker is returned to its start point. The tracker is then marked at returned in the database. What I am trying to do is use a form with a combo box that contains all the tracker numbers to find shipments where the tracker number has not been returned. The table that contains the data is called Master. it has the following fields. Shipment Number (Primary Key), Tracker Assigned 1 (contain the number of the GPS tracker on the shipment), Tracker Returned 1 (Check box that shows a tracker as being returned when it is checked), Tracker Assigned 2, Tracker Returned 2. Tracker Assigned and Tracker Returned field go up to 30. Thus we can assigned up to 30 GPS trackers per shipment.



    How can I get the form to search all 30 Tracker Assigned and Tracker returned fields and display the record of the selected tracker number in the Tracker List Combo box that has not been returned. There should only be one record for the tracker number that has not been returned in the database since we can only use the tracker once per shipment and cannot add it to another shipment until it has been marked as returned in the database.

    Here is a snap of the form in design view. I hope you can help. Unfortunately I am new to Access and have not had any training, but I am learning, thanks to those on this forum.

    Click image for larger version. 

Name:	Form design view.PNG 
Views:	11 
Size:	36.3 KB 
ID:	35081

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You have 30 fields that hold same kind of data and want to search all of them for the same info? This is not a normalized data structure and therefore your task will be harder to accomplish. Options:

    1. VBA code that cycles through all 50 fields and compares data

    2. dynamic parameterized query with same criteria under each of the 30 fields with OR operator

    3. a UNION query that rearranges data into normalized structure and use that query to apply filter for the desired record


    Suggest a DateReturned date/time field would be more informative than just a yes/no field.

    This db reminds of a library checking books out/in. Each shipment and assigned trackers would equate to a person checking out books. You might look at the MS LendingLibrary template database.
    Last edited by June7; 08-12-2018 at 12:57 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-13-2016, 02:04 PM
  2. Combo box to find a record
    By Access_Novice in forum Forms
    Replies: 4
    Last Post: 09-04-2014, 08:48 AM
  3. Find Record from a Combo Box
    By Paul H in forum Forms
    Replies: 10
    Last Post: 05-12-2014, 07:55 AM
  4. Replies: 5
    Last Post: 11-13-2010, 04:56 PM
  5. Replies: 4
    Last Post: 07-22-2009, 02:33 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