Results 1 to 4 of 4
  1. #1
    csd003 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    2

    Creating an IF statement within a Form

    Hi, I am currently trying to create a form where I am able to check yes or no (start and stop in this situation) to categorize whether or not a person (in this situation a taxi cab driver) is using a certain cab number. The problem I am having is that I can't quite seem to find a way to make it where the cab driver can only be driving 1 cab at a time and that when i have "start" checked off next to their name, i can't place another "start" with their name and another cab number unless i check "stop" with the previous cab number which was assigned to them. Any ideas on how I should approach this? (Sorry fairly new to MS Access and don't know if i explained the situation correctly, let me know if i need to elaborate or re-explain something. Thanks!)

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm not clear on how you're trying to design it, but I have actually designed this type of thing for cab companies. I create a drivers table, a cars table, and an activity table. That table has fields for the driver, car, start and end date/time fields (among others). Each time a driver/car go out is a new record in that table. That way I can tell who was in a given vehicle at any point in time (car 123 ran into somebody yesterday at 2pm; who was in it?).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    csd003 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    2
    I am designing it to keep track of permit numbers and from this form page, i'm planning on creating a report to know when a driver had a specific permit number and when they "started" and "stopped" using it. Basically to keep the information organized. The problem I'm having is that i don't know how to make it where if I give 1 driver a certain permit number, that no one can assign another number to them unless that number was checked off start.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Using the table I describe, you can search for records with that permit where the end time is Null (using DCount() or a recordset)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Creating If Statement in form
    By MaxLev in forum Forms
    Replies: 1
    Last Post: 12-11-2012, 02:06 AM
  2. IF(AND Statement in a Form
    By bkirsch in forum Access
    Replies: 1
    Last Post: 02-03-2012, 09:57 AM
  3. Main Form If Statement
    By qbc in forum Forms
    Replies: 1
    Last Post: 01-21-2012, 05:27 PM
  4. If Statement in form
    By ismith in forum Forms
    Replies: 3
    Last Post: 12-07-2011, 12:18 PM
  5. Replies: 7
    Last Post: 08-17-2011, 01:49 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