Return without GoSub
Hej alle,Jeg får sådan en periodefejl når jeg åbner min database.
"The expression On Load you entered as the event property setting produced the following error: Return without GoSub"
Sidder jeg så og roder lidt rundt, så stopper den med at dukke op, men når jeg så kopir den over i en anden mappe, så dukker den op igen. :(
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo Err_Form_KeyDown
If KeyCode = vbKeyF2 Then
cmdlast_Click
End If
If KeyCode = vbKeyF3 Then
cmdnow_Click
End If
If KeyCode = vbKeyF4 Then
cmdnext_Click
End If
If KeyCode = vbKeyF5 Then
cmdAll_Click
End If
Select Case KeyCode
Case vbKeyUp: DoCmd.GoToRecord , , acPrevious
Case vbKeyDown: DoCmd.GoToRecord , , acNext
End Select
Exit_Form_KeyDown:
Exit Sub
Err_Form_KeyDown:
prompt = "Indtast de manglende oplysning, eller tryk F3 for fortryd!"
If MsgBox(prompt, vbOKOnly, "Fejl") = vbOK Then
Resume Exit_Form_KeyDown
End If
End Sub
Private Sub Form_Load()
Me.Filter = "([SettledCustomer] = False)"
Me.FilterOn = True
WeekNumber = DatePart("ww", Date)
cmdLast.Caption = "Uge " & WeekNumber - 1 & vbNewLine & " / F2"
cmdNow.Caption = "Uge " & WeekNumber & vbNewLine & " / F3"
cmdNext.Caption = "Uge " & WeekNumber + 1 & vbNewLine & " / F4"
End Sub