Hello,
I am desperate, as this keeps me now for more then 3 hours.
I run a switchboard which shows different items depending on the users login i.e. rights. That's why the "back"-Button cannot be fixed with one value for all users, but needs to be dynamic. Therefore I've written this code:
But the len-function always returns 2, even the strSwitchboards is "1234".
Who can help?
Thank you so much in advance.
Mary H.
I am desperate, as this keeps me now for more then 3 hours.
I run a switchboard which shows different items depending on the users login i.e. rights. That's why the "back"-Button cannot be fixed with one value for all users, but needs to be dynamic. Therefore I've written this code:
Code:
Private Function HandleButtonClick(intBtn As Integer)
' This function is called when a button is clicked.
' intBtn indicates which button was clicked.
' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8
Const conCmdOpenPage = 9
Const conCmdReturnToSwitchboard = 10
' An error that is special cased.
Const conErrDoCmdCancelled = 2501
Dim con As Object
Dim rs As Object
Dim stSql As String
Dim strFormerSwitchboard As String, lngLänge As Long
'On Error GoTo HandleButtonClick_Err
...
Select Case rs![Command]
' Go to another switchboard.
Case conCmdGotoSwitchboard
strSwitchboards = strSwitchboards & CStr(Me.SwitchboardID)
Me.Filter = "[ItemNumber] = 0 AND [SwitchboardID]=" & rs![Argument]
...
' Go back one step
Case conCmdReturnToSwitchboard
strFormerSwitchboard = Right(strSwitchboards, 1)
Me.Filter = "[ItemNumber] = 0 AND [SwitchboardID]=" & strFormerSwitchboard
Left(strSwitchboards, len(strSwitchboards) -1)
End Select
...
End Function
But the len-function always returns 2, even the strSwitchboards is "1234".
Who can help?
Thank you so much in advance.
Mary H.
Last edited by a moderator: