Hi,
You here is the full coding behind my form. Hope you can give me some
tips.
Below is the full coding:
Private Sub CmdSubmit_Click()
'See if there is a record in the text fiel then take action
If IsNull(Me.TxtAnswer) Or Me.TxtAnswer = "" Then
MsgBox "You must at least attemp the question by giving a guest",
vbExclamation, "Answer Required"
Me.TxtAnswer.SetFocus
Exit Sub
End If
'Check if the answer is correct
If Me.TxtAnswer.Value = DLookup("[Answer]", "[Answer]", "[ID]= " &
Forms![Answers5]![ID]) Then
Me.TxtAnswer.SetFocus
MsgBox "Correct, you have scored 5 points." & vbCrLf & vbCrLf & "Try
The Next One!!", vbOKOnly + vbInformation, "Feedback"
DoCmd.GoToRecord acDataForm, "Answers5", acNext
Else
MsgBox "Incorrect, you have scored 0 point." & vbCrLf & vbCrLf & "Try
The Next One!!", vbOKOnly + vbInformation, "Feedback"
DoCmd.GoToRecord acDataForm, "Answers5", acNext
Exit Sub
End If
End Sub
-------------------------------------------------------------------------------------------------------------------------------------
Private Sub Form_Current()
With Me.RecordsetClone
If Me.NewRecord Then
CmdSubmit.Enabled = False
Me!CmdPreviewPrint.Enabled = True
Me!TxtAnswer.Visible = False
Me!Questions.Visible = False
LblMessage.Visible = True
Else
CmdSubmit.Enabled = True
Exit Sub
End If
End With
End Sub
---------------------------------------------------------------------------------------------------------------------------------
Private Sub Form_Load()
'Disable the Preview button
Me!CmdPreviewPrint.Enabled = False
End Sub
----------------------------------------------------------------------------------------------------------------------------------
Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
MsgBox "Sorry Mousewheel has been disabled you can't navigate through."
& vbCrLf & vbCrLf & "Give an Answer first", vbOKOnly + vbInformation,
"Information"
Exit Sub
End Sub
There you have it. I hope you can give me some help if there is
anything wrong with it. By the way do you happen to know how to disable
the keypad on the keyboard?.
Thanks in advance!!!!!!!!
First, set the form's AllowAdditions property to No. That will prevent
the
form from going to a new record as a precaution.
Do you want the message to show when the user tries to move beyond the
last
record, or when the user gets to the last record?
Post the code that is in your button's click event procedure.
--
Ken Snell
<MS ACCESS MVP>
I mean that When you press the button, you go to the next record until
you reach the last record in the form. But I Do Not want the user to go
beyond that last record. What I want also is that when the user
navigates and reaches the last record in the form, a message comes up
saying "you have reached the last record. This form will now open a
report" and the button(that navigates through the records) is disabled
(so he can't go through).
I hope you do understand my concern. I will appreciate if you van help
me.
Thanks in advance!!!
Ken Snell (MVP) wrote:
Define "last record" -- is it the "last record" that is being
displayed
in
the form? Or the record with the most recent date/time value in it? Or
something else?
What do you mean "stop at the last record"?
--
Ken Snell
<MS ACCESS MVP>
Hi everyone,
I have an access form where I have a button that upon clicking on
it,
goes to the next record. But I want it to stop at the last record
and
perform an action then. can anyone kind enough help me please?.
Thanks in advance!!!!!