I'm trying to deactivate the page down key in my form with no luck. Can you help me deactivate the page down key. Here's the steps I have already completed.
I opened the form in design view, set KeyPreview Property to Yes, selected Database Tools, Visual Basic and inserted code in lines 3 through 9 after the dash / line.
Update_Total
'
'------------------------------------------------------------
Function Update_Total()
On Error GoTo Update_Total_Err
Private Sub form_keydown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyPageDown
MsgBox "The Page Down Key Cannot be Used!"
KeyCode = 0
End Select
End Sub
DoCmd.OpenForm "REFERRAL", acNormal, "", "", , acNormal
Forms!REFERRAL![Quote Date] = Now()
DoCmd.RunMacro "Update_Referral", , ""
DoCmd.OpenForm "RATING ENGINE", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Primary Rating 1", , ""
DoCmd.RunMacro "Update_Primary Rating 2", , ""
DoCmd.RunMacro "Update_Primary Rating 3", , ""
DoCmd.OpenForm "RATING ENGINE 2", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Excess Rating 1", , ""
DoCmd.RunMacro "Update_Excess Rating 2", , ""
DoCmd.OpenForm "RATING ENGINE 3", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Total Rating1", , ""
DoCmd.RunMacro "Update_Underwriting Forms", , ""
DoCmd.OpenForm "REFERRAL", acNormal, "", "", , acNormal
DoCmd.RunCommand acCmdRefresh
DoCmd.Close acForm, "REFERRAL"
Update_Total_Exit:
Exit Sub
Update_Total_Err:
MsgBox Error$
Resume Update_Total_Exit
End Sub
I opened the form in design view, set KeyPreview Property to Yes, selected Database Tools, Visual Basic and inserted code in lines 3 through 9 after the dash / line.
Update_Total
'
'------------------------------------------------------------
Function Update_Total()
On Error GoTo Update_Total_Err
Private Sub form_keydown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyPageDown
MsgBox "The Page Down Key Cannot be Used!"
KeyCode = 0
End Select
End Sub
DoCmd.OpenForm "REFERRAL", acNormal, "", "", , acNormal
Forms!REFERRAL![Quote Date] = Now()
DoCmd.RunMacro "Update_Referral", , ""
DoCmd.OpenForm "RATING ENGINE", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Primary Rating 1", , ""
DoCmd.RunMacro "Update_Primary Rating 2", , ""
DoCmd.RunMacro "Update_Primary Rating 3", , ""
DoCmd.OpenForm "RATING ENGINE 2", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Excess Rating 1", , ""
DoCmd.RunMacro "Update_Excess Rating 2", , ""
DoCmd.OpenForm "RATING ENGINE 3", acNormal, "", "", , acNormal
DoCmd.RunMacro "Update_Total Rating1", , ""
DoCmd.RunMacro "Update_Underwriting Forms", , ""
DoCmd.OpenForm "REFERRAL", acNormal, "", "", , acNormal
DoCmd.RunCommand acCmdRefresh
DoCmd.Close acForm, "REFERRAL"
Update_Total_Exit:
Exit Sub
Update_Total_Err:
MsgBox Error$
Resume Update_Total_Exit
End Sub