Results 1 to 5 of 5
  1. #1
    Darth21 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Los Angeles, CA
    Posts
    15

    Visual Basic

    I created a Vehicle Maintenance Database for our company vehicle. There are four shift in a day for example: There is Early Morning shift, Day shift, Mid Shift and Swing Shift. Each employee is to check out the vehicle and inspect it for dents and scratches and make a notification on the vehicle checkout sheet. I then input the changes in the Vehicle Checkout Log in Microsoft Access. I created a tab for all four shift within the form, but i am getting error messages.



    So i want to use Visual Basic using a combo box to show when i select Day Shift the form appear, and when nothing is selected it doesn't show up. but this requires visual basic code which i am not familiar with. Do any one know how to do this?

    Thanks for any input would help.

    Darth21.
    Last edited by Darth21; 08-10-2014 at 02:36 PM. Reason: attachment

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What are the error messages?

    At least one page of a tab control must always be visible.

    Really need to know more about the db structure. If you want to provide for analysis, follow instructions at bottom of my post.
    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.

  3. #3
    Darth21 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Location
    Los Angeles, CA
    Posts
    15
    The error message that i get says: "The changes you requested to the table were not successful because they would create duplicate vales in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."

    When I hit the undo button and move to a new record and go back it lets me enter information into the tab and everything is ok, but when i try to do a new record and enter information into the tab it gives that error message again.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Error message seems clear enough. Whatever you are doing for data entry is causing duplication of data that can't be duplicated.

    Like I said, need to know more about db structure.
    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.

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Your table must have keys that dont allow mutiple records on something. The form is adding these.

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

Similar Threads

  1. Visual Basic Code for If Else
    By Baldeagle in forum Programming
    Replies: 1
    Last Post: 09-14-2012, 08:46 AM
  2. Visual Basic
    By kwooten in forum Queries
    Replies: 2
    Last Post: 01-25-2012, 08:22 AM
  3. Can't see visual basic code
    By Michele Keck in forum Forms
    Replies: 5
    Last Post: 09-29-2010, 11:31 AM
  4. Query in visual basic
    By Lucas83 in forum Programming
    Replies: 1
    Last Post: 06-10-2010, 11:00 AM
  5. Record Value in Visual Basic
    By chrismec in forum Programming
    Replies: 3
    Last Post: 12-09-2009, 04:14 PM

Tags for this Thread

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