Created
March 29, 2019 21:09
-
-
Save blubbll/78344abe599cc190b1ad8d68505bcca9 to your computer and use it in GitHub Desktop.
vba stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function goForward() | |
On Error GoTo fehler | |
curId = Screen.ActiveForm.idFeld.Value | |
DoCmd.OpenForm FormName:=Screen.ActiveForm.Name, _ | |
OpenArgs:="Suche bei " & Screen.ActiveForm.Name, _ | |
WhereCondition:="ID = " & curId + 1 ' Hier ist wichtig, dass ID keine Strings hat, sondern der Bedingung als Integer übergeben wird. | |
lastId = curId | |
GoTo ende | |
fehler: | |
MsgBox "Datensatz nicht vorhanden." | |
DoCmd.OpenForm FormName:=Screen.ActiveForm.Name, _ | |
OpenArgs:="Suche bei " & Screen.ActiveForm.Name, _ | |
WhereCondition:="ID = " & lastId ' Hier ist wichtig, dass ID keine Strings hat, sondern der Bedingung als Integer übergeben wird. | |
ende: | |
End Function | |
Function goBackward() | |
curId = Screen.ActiveForm.idFeld.Value | |
If (IsNull(curId)) Then curId = lastId + 1 | |
If (curId) >= 1 Then | |
DoCmd.OpenForm FormName:=Screen.ActiveForm.Name, _ | |
OpenArgs:="Suche bei " & Screen.ActiveForm.Name, _ | |
WhereCondition:="ID = " & curId - 1 ' Hier ist wichtig, dass ID keine Strings hat, sondern der Bedingung als Integer übergeben wird. | |
End If | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment