How to show a promt for any change detected in excel sheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anubhav Mital
    New Member
    • Jun 2010
    • 11

    How to show a promt for any change detected in excel sheet

    i have a project in which we have a database as backend and excel as front end in it first we allow user to access the data of MS Access in excel and update it then we get it saved at some place. now administrator needs help that he wants a prompt every time for the changes that have been made in data...
  • ahmedtharwat19
    New Member
    • Feb 2007
    • 55

    #2
    There are some methods to do this after any events :

    Code:
    DoCmd.RunCommand acCmdSaveRecord
    or :

    Code:
    DoCmd.Save acTable, "TabelName"
    also, you can use this code with above:

    Code:
    DoCmd.RunCommand acCmdRefresh
    may it help.

    Best Regards,

    Ahmed Tharwat (Medo)

    Comment

    • Anubhav Mital
      New Member
      • Jun 2010
      • 11

      #3
      Thanx for ur help

      But can u make it more clear. I am new to VB. I also need some suggestion for the case that if we have to copy any excel sheet into another excel sheet of one workbook to another...

      Comment

      • ahmedtharwat19
        New Member
        • Feb 2007
        • 55

        #4
        what i understand, you have a excel file linked with ms access and you need after any change in ms access are changed in excel. is that true?

        if yes:
        The above code is the correct answer for that ,
        just you can make event after you exit from the record
        in after update event but the code

        Code:
        DoCmd.RunCommand acCmdSaveRecord .
        DoCmd.RunCommand acCmdRefresh
        or

        Code:
        DoCmd.Save acTable, "TabelName" 
        DoCmd.RunCommand acCmdRefresh
        if no:
        You can attach the example and explain what do you need.

        Best Regards,
        (Medo)

        Comment

        • Anubhav Mital
          New Member
          • Jun 2010
          • 11

          #5
          Thanx for these solutions sir,
          But i just want to copy content of one excel sheet to another new excel sheet then the administrator will do the rest so tell me how i can copy content of one sheet to another

          Comment

          • ahmedtharwat19
            New Member
            • Feb 2007
            • 55

            #6
            you can use this code from excel vba editor

            Code:
            Sub CopySheet()
               Application.ScreenUpdating = False
               Workbooks("Book2").Sheets.Add.Name = "Copied"
               Cells.Copy
               Workbooks("Book2").Sheets("Copied").Range("A1").PasteSpecial
               ActiveSheet.DrawingObjects.Copy
               Workbooks("Book2").Activate
               ActiveSheet.Paste
               ActiveSheet.Cells.Copy
               Range("A1").PasteSpecial xlPasteValues
               ThisWorkbook.Activate
               Application.CutCopyMode = False
               Application.ScreenUpdating = True
            End Sub
            or you can use sql update to update sheet2 as sheet1 from ms access.

            attach the sample to understand what do you need.

            i`m very sorry my english is very bad.
            Last edited by Niheel; Jun 9 '10, 11:40 AM. Reason: no signatures in posts, please

            Comment

            • Anubhav Mital
              New Member
              • Jun 2010
              • 11

              #7
              No issues even my english has a lot of problems....:)

              Comment

              Working...