form shows wrong data not resetting (1 Viewer)

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
hi please see attached which was i have made with help from you lovely people on this site but as its Xmas was gonna roll it out for an office Xmas quiz bit of fun

but on testing once you have finished and start again with a new named player it goes to last question straight away for some reason, not sure why :banghead:

you can answer that question but then rightly it says no more questions, as there isn't as that was the last question

please help me get out of this loop

cheers
 

Attachments

  • Quiz-A-Rama 2.zip
    105.8 KB · Views: 159

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
Everything appears to be hardcoded?
I get an error for the png file in G:\ whatever?

Best to keep associated file relative to the DB.?
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
yeah looked at that but at the minute try and fix the form thingy, and between you and me not sure how i do that

guess i attach the files and then link to them some how
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
I got rid on the attachments and got 16?
The when I started again I got 'your cannot disable a control that has the focus'

Control is Forms!F_Start.cmd_Start.Enabled = False in Cmd.Click
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
I got rid on the attachments and got 16?
The when I started again I got 'your cannot disable a control that has the focus'

Control is Forms!F_Start.cmd_Start.Enabled = False in Cmd.Click

HUH :confused::banghead: not more dam bugs

downloads my own upload
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
I am getting the same questions?
I commented out the disable as it is disabled by defaul t in the form?

HTH
 

Attachments

  • Quiz-A-Rama 2.accdb
    964 KB · Views: 145

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
I am getting the same questions?
I commented out the disable as it is disabled by defaul t in the form?

HTH

do you mean you are able to answer the questions and then repeat it as some one new

as i just downloaded your upload and tried and tried again and Bam shows me question 13 right away
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
No, I got question 1, but the same question 1 from my first run. I just clicked the first button all the way through, got my result, clicked to start again, put in a new name, and then the same questions. ?

Let me try again.
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
OK, now I get q13 on a new start and also the start button is enabled. Plus I get a score of 5 for one question. :)
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
Could it be this in Form start?
Code:
Private Sub Form_Open(Cancel As Integer)
 Dim rst As DAO.Recordset
  
  Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT QRoundNo, Person " _
  & "FROM tblResult")
  If Not rst.EOF Then
   [COLOR="Red"][B] rst.MoveLast[/B][/COLOR]
    Me.txt_EntriesJHB = rst.RecordCount
  Else
    Me.txt_EntriesJHB = 0
  End If
  Me.QuestionRoundNo = 1
End Sub
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
Could it be this in Form start?
Code:
Private Sub Form_Open(Cancel As Integer)
 Dim rst As DAO.Recordset
  
  Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT QRoundNo, Person " _
  & "FROM tblResult")
  If Not rst.EOF Then
   [COLOR="Red"][B] rst.MoveLast[/B][/COLOR]
    Me.txt_EntriesJHB = rst.RecordCount
  Else
    Me.txt_EntriesJHB = 0
  End If
  Me.QuestionRoundNo = 1
End Sub

no, commented that out and still sent me to the last dam question
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
prehaps it could be something to do with this section of code in frmQuestions

Code:
Private Sub RegisterChoice(TheChoise As Control)
  Dim x As Integer

  'Save the choise and other relevant data
  CurrentDb.Execute ("INSERT INTO tblResult (QRoundNo, Person, QuestionNo, Question,  ChoiseNo, Choise, Correct  ) " _
  & "VALUES (" & TempVars!QRoundNo & ", '" & TempVars!PlayerName & "', " & Right(Me.QuestionNo.Caption, Len(Me.QuestionNo.Caption) - 9) & ", '" & Me.Question & "', " & Right(TheChoise.Name, 1) & ", '" & TheChoise.Caption & "', " & TheChoise.Tag & ")")
  Me.GotoNextQuestion.Enabled = True
  For x = 1 To 4
    'Make all choises unavailable
'    Me("Choise" & x).Visible = True
'    Me("Choise" & x).Enabled = False

  'Find out if a choise is right or wrong, show a message
  Next x
  'Me.FiftyFifty.Enabled = True
  
    RememberQuestionNo = RememberQuestionNo + 1
    Call GetQuestion
  
End Sub
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
There is a lot of strange goings on.

Sometimes when you tab out of the name, it does not wnable the start button but goes to the Admin button.?
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
I think it is this in Form start on the start button?

Code:
DoCmd.OpenForm "frmQuestions", , , , , , Me.QuestionRoundNo
 

Dreamweaver

Well-known member
Local time
Today, 03:31
Joined
Nov 28, 2005
Messages
2,466
I have a random question thing in an old project I could pull it out for you and upload it to my site let me know and I'll sort it tomorrow after work if not I might add it later anyway.


mick
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:31
Joined
Sep 21, 2011
Messages
14,231
You are not opening the form questions any subsequent time so the questionno never gets reset?,
Close both forms in frmresults

Code:
Private Sub cmd__Click()
Me.Visible = False
DoCmd.Close acForm, "F_Start"
DoCmd.Close acForm, "Frmquestions"
DoCmd.OpenForm "F_Start"

'Forms!F_Start.txt_UserName.Value = ""
'Forms!F_Start.cmd_Start.Enabled = False
End Sub

Still get the same questions though?
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
You are not opening the form questions any subsequent time so the questionno never gets reset?,
Close both forms in frmresults

Code:
Private Sub cmd__Click()
Me.Visible = False
DoCmd.Close acForm, "F_Start"
DoCmd.Close acForm, "Frmquestions"
DoCmd.OpenForm "F_Start"

'Forms!F_Start.txt_UserName.Value = ""
'Forms!F_Start.cmd_Start.Enabled = False
End Sub

Still get the same questions though?

ill give it a go know and let you know the outcome
 

murray83

Games Collector
Local time
Today, 03:31
Joined
Mar 31, 2017
Messages
728
i could bloody kiss you Gasman

it's alive woop cheers for that
 

Users who are viewing this thread

Top Bottom