Solved Why does it crash and close...

murray83

Games Collector
Local time
Today, 21:27
Joined
Mar 31, 2017
Messages
768
So have had to use google drive as file is a bit bigger then here to upload

but i have an issue not sure why it does and hoping that some one here can shed some light. The issue i have is when it gets to a question which has a video it seems to crash and I'm not sure the reason

AWF Example - Video Quiz

Cheers all for looking
 
in my opinion I don't think that the video will play asynchronized with you app.
you will have to wait till the video finished playing before you can
interact with your form. or maybe i am wrong.
 
OK so saying video length is to long or need wait for vid to finish before moving or add some code when user press a button then it kills the video player
 
suggestions ?

how would i kill the video player when choise is made ?

or

Making the video shorter be better ?
 
So i went down the code route and added this

Code:
  Me.WMPQuizVid.Visible = False
  Me.WMPQuizVid.URL = ""

to

my sub ( At the top in below code ) and now this works like a charm, cheers for the input @arnelgp about video not matching up

Code:
Private Sub GetQuestion()
  Dim dbs As DAO.Database, rst As DAO.Recordset, x As Integer
 

 
 
  Set dbs = CurrentDb
  Me.WMPQuizVid.Visible = False
  Me.WMPQuizVid.URL = ""
  Me.QImage.Visible = False
  Me.Question.Width = 6804 'Set the full width of the question box
  'Me.GotoNextQuestion.Enabled = False
  'Me.FiftyFifty.Enabled = True
  'Get the question and choices from the tables according to the question round number and question number
  Set rst = dbs.OpenRecordset("SELECT tblQuestionChoice.ChoisePicture, tblQuestions.QRoundNo, tblQuestions.QuestionNo, Question, ChoiseNo, Choise, RightAnswer, ImageAttached, VideoAttached " _
  & "FROM tblQuestions INNER JOIN tblQuestionChoice ON (tblQuestions.QuestionNo = tblQuestionChoice.QuestionNo) AND (tblQuestions.QRoundNo = tblQuestionChoice.QRoundNo) " _
  & "WHERE tblQuestions.QRoundNo=" & TempVars!QRoundNo & " AND tblQuestions.QuestionNo=" & RememberQuestionNo & ";")
 
  If Not rst.EOF Then 'Is some data found?
    'Yes data found, then prepare the form
    Me.Caption = "Question " & rst![QuestionNo] 'Set the form's caption
    Me.QuestionNo.Caption = Me.Caption 'Set the QuestionNo (label) caption
    Me.Question = rst![Question] 'Set the Question
    
    If Not IsNull(rst![ImageAttached]) Then 'Some picture is attached to the question
      'Me.Question.Width = 4479 'Reduce the width of the question box so the picture box not covered some of the question
      Me.QImage.Visible = True 'Show the picture box
     Me.QImage.Picture = rst![ImageAttached] 'Put the picture in the picture box
    End If
    
    'for video attempt
      If Not IsNull(rst![VideoAttached]) Then 'Some video is attached to the question
      'Me.Question.Width = 4479 'Reduce the width of the question box so the video box not covered some of the question
      Me.WMPQuizVid.Visible = True 'Show the video box
      Me.WMPQuizVid.uiMode = "none" 'trying to hide play back buttons
     Me.WMPQuizVid.URL = rst![VideoAttached] 'Put the video in to play ?
    End If
        
    
    For x = 1 To 4 'Prepare the 4 choises button
      Me("Choise" & x).Visible = True 'Make the button visible
      Me("Choise" & x).Enabled = True 'Make the button enable
      Me("Choise" & x).Picture = Nz(rst![ChoisePicture], "") ' To put a picture in the button - added by me as suggested by theDBguy
      Me("Choise" & x).Caption = Nz(rst![Choise], "") 'Put the choise in the button's caption
      Me("Choise" & x).Tag = rst![RightAnswer] 'Mark the button as right or wrong choise
      rst.MoveNext
    Next x
    
  Else
    Me.Visible = False
    MsgBox ("Sorry, no more questions!") 'Question round is finish
    Me.TimerInterval = 0 'should stop the timer on the results page so doesent keep counting up
    DoCmd.OpenForm "F_Results"
    Forms!F_Results.Refresh
    Forms!F_Results!txtSecondsTaken.Value = txtYouHaveTaken.Value
    
  End If
End Sub

see attached version you'll have to supply own videos though hehe
 

Attachments

Your original question of "why does it crash and close?" is one I can't answer - but I CAN tell you one way to get more info, if you have admin rights on the machine in question. A simple exit is unlikely to trigger an event log but a real program crash will probably leave behind traces in the system's "Application Log."

First, do whatever it is that usually triggers the crash/close behavior. Let it do its thing.

When it crashes, get the time of day from the date/time readout in the lower right on the task bar.

Launch "Event Viewer" and select "Application Log."

Look for events at or within a minute either way of the observed time. System events are displayed in chronological order so this part should be easy. Just scroll to the correct time. Also, the time on the taskbar is the same time used for event logging so it should be easy to find that time.

The viewer format depends on which version of Windows you have. On Win11, there is a "General" tab and a "Details" tab for the viewer. "General" should say in words what it thinks went wrong. The "Details" might show you a 32-bit hexadecimal code that would be something you could look up for more details. I don't remember the format used by Win10's event viewer but they are at least similar.
 
Your original question of "why does it crash and close?" is one I can't answer - but I CAN tell you one way to get more info, if you have admin rights on the machine in question. A simple exit is unlikely to trigger an event log but a real program crash will probably leave behind traces in the system's "Application Log."

First, do whatever it is that usually triggers the crash/close behavior. Let it do its thing.

When it crashes, get the time of day from the date/time readout in the lower right on the task bar.

Launch "Event Viewer" and select "Application Log."

Look for events at or within a minute either way of the observed time. System events are displayed in chronological order so this part should be easy. Just scroll to the correct time. Also, the time on the taskbar is the same time used for event logging so it should be easy to find that time.

The viewer format depends on which version of Windows you have. On Win11, there is a "General" tab and a "Details" tab for the viewer. "General" should say in words what it thinks went wrong. The "Details" might show you a 32-bit hexadecimal code that would be something you could look up for more details. I don't remember the format used by Win10's event viewer but they are at least similar.

Cheers for that and yeah, at work don't have that access ( Boo ) but always good to have any way of investigating what occurred on a PC not locked down. So cheers for the input of info always appreciated :)
 
Cheers for that and yeah, at work don't have that access ( Boo ) but always good to have any way of investigating what occurred on a PC not locked down. So cheers for the input of info always appreciated :)
Are you sure?
You cannot do any damage with Event Viewer I believe.
Hit the Search icon and type in Event Viewer
 
The viewer format depends on which version of Windows you have. On Win11, there is a "General" tab and a "Details" tab for the viewer. "General" should say in words what it thinks went wrong. The "Details" might show you a 32-bit hexadecimal code that would be something you could look up for more details. I don't remember the format used by Win10's event viewer but they are at least similar.
i think the viewer is too complicated and does not offer any remedy or pin point which line in your program has faulted.
there are lots of dependencies being dump. totally useless to us mortals.
 
Are you sure?
You cannot do any damage with Event Viewer I believe.
Hit the Search icon and type in Event Viewer
Afraid so 😟
 

Attachments

  • DSC_1004.JPG
    DSC_1004.JPG
    2.9 MB · Views: 11
You cannot do any damage with Event Viewer I believe.
@Gasman Locking Event viewer is the first thing any IT will do.
Event Viewer can contain sensitive information such as system errors, application-specific data that might reveal vulnerabilities, and even user activity logs. Hackers use Event viewer to gain ciritical information about the machine.
Users might also accidentally or intentionally delete, modify, or alter event logs. These kind of tampering is normally used to cover up their activity and to hide the steps they took to exploit the system.
 
i think the viewer is too complicated and does not offer any remedy or pin point which line in your program has faulted.
there are lots of dependencies being dump. totally useless to us mortals.

@arnelgp, I believe you overlook the possibility that someone can take a screen shot or write down the contents of a particular event. They can then bring it over to the forum and ask what it means. That HAS happened a few times in the past. You neglect to consider that most of the time, when you have a process crash in Windows, you rarely see an error code. Your process just goes away. What I described is a way to get an error message. You would also see if the crash occurred in Access itself (MSACCESS.EXE) or a library (something.DLL) or a support task. Knowing what error occurred and in which module or component it occurred are two VERY IMPORTANT clues in answering the "what just happened?" question. Which IS, after all, why some people come here.

Unfortunately, you ARE correct that we cannot pinpoint a particular failed line if we are forced to use Event Viewer. But if we are resorting to Event Viewer, it means we weren't so lucky as to have Access take a breakpoint on error and highlight the failing line. (And in the process GIVE us an error code immediately.) The viewer itself is not that complicated. Open it. Open the Application Log, which is sorted by date/time of the event. Find the event. At most you have two screens to read - general and details.
 
Cheers for that and yeah, at work don't have that access ( Boo ) but always good to have any way of investigating what occurred on a PC not locked down. So cheers for the input of info always appreciated :)

Talk to your IT group, explain to them that you have a program crash that will require reading an event log for an event at a known date/time, and ask them for assistance in getting an error code from the event report to help trouble-shoot the problem. If their problem is simply that for security purposes they hide Event Viewer's snap-in behind a policy, it probably is because they don't want you browsing through system events or deleting system event records. What you want is a system event log that will be logged within one minute of the time you noted, and the program that crashes will be MSACCESS.EXE (about 99+% of the time in the stated situation). Should be easy to find.
 
Then again, there is always walking the code, one line at a time?
 

Users who are viewing this thread

Back
Top Bottom