By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,671 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,671 IT Pros & Developers. It's quick & easy.

Record the change and playback them as a video

P: 12
Hi Gents

I have one form which I need to record all the change that may happen to this Form for the last 10 minute (this form was created by VBA code and take his information from an Excel sheet, this form has different values which go up and down based on the value we entered in the excel sheet), and I would like to be able to playback this change in a video.

I need to record all of these changes and be able to go back and see all this change for the last 10 minute as it happened now by pressing a command button called playback...

I mean it is like someone videoing all your action for the last 10 minute and play them back...

Hope that I made myself clear enough, and please if u need any further explanation let me know!!!

Regards
Feb 29 '12 #1
Share this Question
Share on Google+
16 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
This is by no means a simple requirement. You can use a third party software to record your screen, but it would likely have to be manually started/stopped. Also note that most screen recorders are quite intensive in memory/harddisk usage, and having 1 run constantly will slow down most computers.

If you want to continually run audit trails, I suggest you use the AfterUpdate/BeforeUpdate event of your forms as a trigger to record what is going on.
Feb 29 '12 #2

P: 12
Hi, and thank u for ur reply...

I totally agree it will usage alot of memory in hard disk, that is why I will store everything in tetra external hard disk, and what I need is to record only the last 10 minute, and when the software is going to save another 10 minutes he will automatically delete the previous one.

But the problem is I need this to be done automatically, I mean I don't need to press a button to do this, only the playback is need to be done by press button, and then the code will display the last 10 minute he saved.

I need this playback feature in order to follow up the mistake when exactly this mistake happen, by seeing exactly what the users has done, so it will make it easy to follow up the error in entry in case of any error.
Feb 29 '12 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
Well then you need to find some recording software that will accept input from code in some manor or another, including instructions to start/stop recording, save it and so on.

I really dont recommend going down this path.

If this is a matter of debugging your application there are more efficient ways to do this.
Feb 29 '12 #4

P: 12
Yes I would like to debug the application, but I need it to be like a real time.

what is the most efficient way to do this?
Feb 29 '12 #5

NeoPa
Expert Mod 15k+
P: 31,276
I don't know of anything out there with this functionality. It would be nice, but would be very difficult to achieve. Particularly as the fact of this code running at all makes the recording of it unreliable.

I suggest you try to work with what is provided and available and look at Debugging in VBA.
Feb 29 '12 #6

P: 12
Hi guys

I think u misunderstood me, I have no problem at all with the code itself, the code works just fine...

Now the problem is: I would like to monitor what the users has done during the last 10 or 15 minutes, because they have to input some value in the excel sheet and that value give a result in the forms, so if they input the wrong value the form will stop responding then I can go back 10 or 15 minutes to see exactly what they have done wrong during the last 10 to 15 minutes before the form stop responding.

I have some kind of report which will give me all the data they have entered, but this report in word file, and what I need to do is to view what they have done as a movie so I can see what exactly went wrong during the operation.

I mean to record all the actions that was taken and view them in some kind of Video!!!

I was thinking of taking a snapshot to the form for each second during the last 10 minutes and then presents these picture in some kind of movie (this idea came from the Cartoon movie)

but the problem is how to do this???
Feb 29 '12 #7

Rabbit
Expert Mod 10K+
P: 12,327
First of all, your code isn't working. If incorrect user input results in the form freezing up, that is the very definition of code that is not working.

Second, what you want to do is extremely difficult. You will have to use a third party tool, such as AutoIT, to accomplish what you want to do.
Feb 29 '12 #8

Expert Mod 2.5K+
P: 2,545
@Amjad, you appear to be taking an approach to user data entry mistakes which defies all logic. You want some form of real-time recording so you can go back 10-15 minutes to see what the user did that was incorrect??

Why not perform data validation at data entry within the Excel worksheet concerned? Is it not simpler to prevent users from entering 'wrong values' than trying to work backwards from the results?

Also, as Rabbit said, if your form is freezing in whatever circumstances you have not got a properly working form. NEVER blame this on your users; this is just poor work by the developer concerned - and if it is you, perhaps you should review whether or not you would prefer to test your form properly before releasing it to users rather than adopt high-tech recording as a means of finding out what you've done wrong in the first place!

-Stewart
Feb 29 '12 #9

NeoPa
Expert Mod 15k+
P: 31,276
Amjad:
I think u misunderstood me, I have no problem at all with the code itself, the code works just fine...
It seems I don't need to explain to you how little sense this statement makes, as two other experts have already done that for me. It's strange that anyone would need to be told at all, but hopefully the situation is clearer to you now.

Debugging your code with some decent test data may help, which is why I linked you to that article. What you choose to do with our help is entirely down to you of course.
Feb 29 '12 #10

P: 12
Hi again and sorry for the delay to reply..

First of all I would like to say that I really appreciate your effort and I know that you are the experts, and may be because the English is not my first language so I was not able to explain what I need very clear...

I will try to explain now with more details and I hope that I will make myself clear this time...

First I know what I want to do is very difficult, that is why I came to here so that I can have some advice from the experts.

I have the form which works more than perfect this form is connected to both real time data coming from field and excel sheet.

it is some kind of control system, (I want to build a simulation for that control system, that is why I used excel sheet for an input)

The form is controlling some pumps and motors, so when the temperature is going high (for example), the users (Operators) should take the right action to open some cooling valve to cool down the pump within 1 minute, or the system will trip this pump, but in some cases they did not take the right action which will make the form stop, and sending a trip signals to the pump (or motor) in order to avoid the damage, so when I said (the form is freezing) I didn't mean that there is something wrong with the form, but this is how I design it, so the form will stop and msgbox will show up says that there is something wrong with the system.

so in order to know what was the wrong with the system I need to go to a very big excel sheet and look into every single cell to see what is wrong, and this may be because of the temperature was high, or low, or may be the pressure was very low... etc, and I need to know what is the wrong action that the user has taken, so that they can learn from their mistake and in order to avoid this when they work with the real system!!!

it is like a training software to train the users on the control system, but since I don't have a real instrument I used an excel sheet as an input for this form to simulate a field instrument.

NOW, what I want do to is just to try to create some kind of monitoring of this form and play back this in front of the users so they will see what excatly they have done, so they will learn from their mistake!!!

I start thinking of taking a snapshot for that form every second and store those snapshot in a file and when I need them I can run them in a very quick way so it will be like video!!!

but again this will need a very big memory space because saving a picture every second for 10 minutes means alot of file!!!

Please see the attached image for the form to get full picture of what I need to do!!!

Hope you will have better solution for me, or u can advice me what to do, I know it is difficult but it is not impossible!!!

Thank you in advance for your help
Attached Images
File Type: jpg Sample.jpg (86.6 KB, 358 views)
Mar 1 '12 #11

Rabbit
Expert Mod 10K+
P: 12,327
Like I said earlier, if you truly want video/screenshots, you need to find a third party tool like AutoIT and read their documentation. I'm not going to do that leg work for you.

However, I strongly advise against taking that approach.

Since every action (user clicks on something) causes a reaction (the click calls a function), then what you should do is log that action with a timestamp. Then you can build in functionality to "replay" a simulation based off the logs.
Mar 1 '12 #12

P: 12
yes this is exactly what I really want to do, I have this log file already timestaped, but how I build this function to replay.
I have seen some third party software and I found it is very hard to go through their documents.

so I start to think about this timestamp log file, but I am lost now, may be I will check tomorrow...

any help will be appreciated
Mar 1 '12 #13

Rabbit
Expert Mod 10K+
P: 12,327
Since you have every action timestamped, to replay it, you just need to read through each log item one at a time and execute the action again. You'll want to use a timer for that, otherwise the screen won't refresh.

If you want a real time simulation, just read the next log item and calculate the difference and set the timer interval accordingly.
Mar 1 '12 #14

Rabbit
Expert Mod 10K+
P: 12,327
Here's a simple example.

I have a form with 3 action buttons, a play button, and a textbox to show the results of an action. Each action logs itself in a table with a timestamp and an action ID. The play button reads the log and reexecutes the action.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Dim rst As Recordset
  5. Dim playback As Boolean
  6.  
  7. Private Sub cmdPlay_Click()
  8.     If Me.cmdPlay.Caption = "Play" Then
  9.         Set rst = CurrentDb.OpenRecordset("SimLog")
  10.         playback = True
  11.         Me.cmdPlay.Caption = "Stop"
  12.         Me.TimerInterval = 1000
  13.     Else
  14.         Call StopPlayback
  15.     End If
  16. End Sub
  17.  
  18. Private Sub Command1_Click()
  19.     If Not playback Then
  20.         DoCmd.SetWarnings False
  21.         DoCmd.RunSQL "INSERT INTO SimLog VALUES (Now(), '1')"
  22.         DoCmd.SetWarnings True
  23.     End If
  24.  
  25.     Me.Text3 = "Command1 Clicked"
  26. End Sub
  27.  
  28. Private Sub Command2_Click()
  29.     If Not playback Then
  30.         DoCmd.SetWarnings False
  31.         DoCmd.RunSQL "INSERT INTO SimLog VALUES (Now(), '2')"
  32.         DoCmd.SetWarnings True
  33.     End If
  34.  
  35.     Me.Text3 = "Command2 Clicked"
  36. End Sub
  37.  
  38. Private Sub Command3_Click()
  39.     If Not playback Then
  40.         DoCmd.SetWarnings False
  41.         DoCmd.RunSQL "INSERT INTO SimLog VALUES (Now(), '3')"
  42.         DoCmd.SetWarnings True
  43.     End If
  44.  
  45.     Me.Text3 = "Command3 Clicked"
  46. End Sub
  47.  
  48. Private Sub Form_Timer()
  49.         Dim oldTime As Date
  50.         Dim newInterval As Integer
  51.  
  52.         Select Case rst("Action")
  53.             Case 1
  54.                 Call Command1_Click
  55.             Case 2
  56.                 Call Command2_Click
  57.             Case 3
  58.                 Call Command3_Click
  59.         End Select
  60.  
  61.         oldTime = rst("ActionTime")
  62.         rst.MoveNext
  63.  
  64.         If rst.EOF Then
  65.             Call StopPlayback
  66.         Else
  67.             newInterval = DateDiff("s", oldTime, rst("ActionTime")) * 1000
  68.  
  69.             If newInterval = 0 Then
  70.                 newInterval = 500
  71.             End If
  72.  
  73.             Me.TimerInterval = newInterval
  74.         End If
  75. End Sub
  76.  
  77. Sub StopPlayback()
  78.     playback = False
  79.     rst.Close
  80.     Set rst = Nothing
  81.     Me.TimerInterval = 0
  82.     Me.cmdPlay.Caption = "Play"
  83. End Sub
Mar 1 '12 #15

100+
P: 759
Also you can track changes in Excel using code similar to this one
(Use it in a Worksheet module):


Expand|Select|Wrap|Line Numbers
  1. Public Sub Test() 'How to apply
  2.     Cells(5, 7) = "This is a test"
  3.     Cells(5, 7) = Empty
  4. End Sub
  5.  
  6. Private Sub Worksheet_Change(ByVal Target As Range)
  7.     MsgBox ("R = " & Target.Row & " , C = " & Target.Column & " , CellValue = " & Target.Value)
  8. End Sub
Mar 2 '12 #16

P: 12
Thank you guys, I will try your solution and I will come back to you with the feedback!!!
Mar 2 '12 #17

Post your reply

Sign in to post your reply or Sign up for a free account.