Page 1 of 4 1234 LastLast
Results 1 to 15 of 46
  1. #1
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62

    Valadation required

    Hi currently i have a table for which i assigned an engineer a vehicle, what i want is a way of not being able to assign a tech a vehicle that is already assigned




    field names
    Tech_Vehicle_ID
    Date_Assigned_To_Tech
    Date_Returned
    Vehicle_Reg
    Assigned_To_Tech

    so if the date_returned was blank then that means its still assigned to a tech so you would not be able to use that vehicle reg untill it has been returned by the tech, this is entered by a form, what the ideal solution would be is when you enter a reg that is already assigned i want a message box, stating that this is with another tech and then that record to automatically pop up for you to unassign it (by entering a Date_Returned. is this something that can be done?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried using a ComboBox on a form for this function?

  3. #3
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    it is a form used to assigned a van to a tech, but you can assigned the same van to lots of techs, i need a way of stopping you choosing a van if it is already with someone, and ideally then bring up that record in a pop up so you can then unassigned the van and then continue with your assign vehicle form.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The ComboBox would allow you to pick a VALID van and then the BeforeUpdate event of the cbo could check and see if it was already assigned and pop up the reassignment form.

  5. #5
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    so a vaild van is any van in my vehicle list even ones assigned to another tech but it wouldnt let me add that entry till it had checked it that vehicle was with somelse. thats exactly what i want, so would i then use the macro builder to write the beforeupdate event.

    This may take sometime.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I don't use Macros so I'm not a lot of help here. I only use code except for the AutoExec macro. If you let the wizard create a cbo that will look up a record (Option #3) you will see the code you need for this function.

  7. #7
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    would it be better to move this tread to programming and ask fir help on the macro in there

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Those that assist here read all of the forums so where it is is not particularly important.

  9. #9
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    ok, ive started to look at the macro builder and im ashuming that i would use

    search for record
    object type table
    object name tech_vehicle

    then the criteria would be where the reg matches the one in the form and shows date-returned as null, but not to sure how to write that

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you let the wizard create a ComboBox for you as an example?

  11. #11
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    yes it didnt really help, im quite a bit out of my confort zone here,

    Ive been playing about a little bit and im guessing i need to use the macro builder on afterupdate, then id want to open table tech_vehicle and search for record then its the where condition = is the bit im struggling.

    i want to say if reg in tech_vehicle form equals reg in tech vehicle table and date_returned is null then open that record to sign the vehicle off (add return date) then continue with my form entry.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What is the RecordSource for your form? Is it the table you described in the first post?

  13. #13
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    yes it is, the reg is pulled from the vehicle table but the record for which tech has it is in tech_vehicle tbl and uses a form with the same name.

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did the wizard create a ComboBox that uses code or macro's?

  15. #15
    bopsgtir is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    62
    it just comes back as

    Option Compare Database
    Private Sub Vehicle_Reg_AfterUpdate()
    End Sub

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Hello! Help required if possible please...
    By MarkGLyons in forum Access
    Replies: 21
    Last Post: 12-28-2010, 05:36 AM
  2. immediate help required
    By pdurgi in forum Access
    Replies: 1
    Last Post: 06-05-2009, 08:21 PM
  3. help required badly
    By pradeep_siemens in forum Programming
    Replies: 0
    Last Post: 05-28-2009, 04:41 AM
  4. Object required
    By duckie10 in forum Access
    Replies: 1
    Last Post: 05-15-2009, 02:11 PM
  5. Replies: 0
    Last Post: 02-15-2007, 03:07 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