Results 1 to 7 of 7
  1. #1
    d3vil112 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    4

    help to make a macro?

    Attachment 3294

    Attachment 3295hi i have been working on a project for a long time and i got stuck. i kinda need help..



    i have attached a file.
    i am working on a project that has to do with car service company.
    so in my program there are six cars each goes to different zones and different zones have diff pays..
    so suppose if a client calls for a car and and if a have a car available i want that car to be sent out to that location..i have done mostly everything but i can't able to make a automate button or whetever so if i choose a car to send it will say car has been sent out. so please help..

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    I think your db may be corrupted. I get an unrecognized format and unable to open it in Access 2007.

    Alan

  3. #3
    d3vil112 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    4
    i have attached another one please check

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Were the accdb projects created with Access2010? I have experienced that Access2010 accdb files cannot be opened by Access2007.

    The tables Inventory, reserved cars, CarOutStatus appear to be one-to-one relationship. Each table has 6 records for the six cars. If this will not change (the tables will each always have a record for each car, even if you add cars to the inventory) I see no reason for separate tables. This is all detail info about each car. One table, one form, simpler data entry, no macro needed, simply change the time value in Time Depart field.

    If you want to stick with this structure then try:
    In AfterUpdate event of the combobox, VBA code (I don't use macros).
    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE CarOutStatus Set [Time Depart] = #" Now() "# WHERE CarID=" & Me.Combo45
    DoCmd.SetWarning True

  5. #5
    d3vil112 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    4
    thats right! but my prof said that i have to make a button to do it for me .. ...for first i was changing it from the caroutstaus table ..but now he said make a macro button so that when u chose ur available cars n then send them out.. so confused

  6. #6
    d3vil112 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2011
    Posts
    4
    i started working on access 2007 i dont knw when it got updated to 2010

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    If your assignment is to design a user-friendly project with GUI then yes, should not be doing data entry directly on tables. That's what forms are for.

    I forgot about the Zone value. Yes, a button does make sense. However, the radio buttons need to be associated with an option group frame so that only one can be selected. Why does code set radselected to a number, the Zone field is text? Checked method won't work with radio button.

    Try:
    Code:
    Private Sub Command48_Click()
    If Me.Frame49 = 1 Then
        radselected = "A"
    ElseIf Me.Frame49 = 2 Then
        radselected = "B"
    ElseIf Me.Frame49 Then
        radselected = "C"
    End If
    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE CarOutStatus Set [Time Depart]=#" & Now() & "#, Zone='" & radselected & "' WHERE CarID='" & Me.Combo45 & "'"
    DoCmd.SetWarnings True
    End Sub

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

Similar Threads

  1. Macro help
    By jcaptchaos2 in forum Access
    Replies: 2
    Last Post: 05-04-2011, 09:50 AM
  2. Help With Macro's
    By GDubbs780 in forum Programming
    Replies: 1
    Last Post: 02-25-2011, 11:43 AM
  3. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  4. VBA Macro
    By DSTR3 in forum Access
    Replies: 1
    Last Post: 11-30-2010, 11:42 AM
  5. Need help with macro
    By abc123 in forum Programming
    Replies: 6
    Last Post: 06-13-2010, 12:34 AM

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