Here's the InputBox I have in my app, I'd like to put a restriction on the amount of data entered.
VB Code:
ganswer = InputBox("New employee " & rs!firstname & " " & rs!lastName & " is not signed off in TK, override?", "", "Y")
Printable View
Here's the InputBox I have in my app, I'd like to put a restriction on the amount of data entered.
VB Code:
ganswer = InputBox("New employee " & rs!firstname & " " & rs!lastName & " is not signed off in TK, override?", "", "Y")
Why not use MsgBox instead;
VB Code:
ganswer = MsgBox("New employee " & rs!firstname & " " & rs!lastName & " is not signed off in TK, override?", vbYesNo)
Here's one way but I wouldn't be surprised if there was an API.
VB Code:
Dim bDone As Boolean Dim strResp As String Dim strDefault As String Const LIMIT As Integer = 5 Do While Not bDone strResp = InputBox("Get input", "My Title", strDefault) If Len(strResp) > LIMIT Then If vbYes = MsgBox("Max length is " & LIMIT & ". Should I truncate your input?", vbQuestion + vbYesNo) Then strResp = Left$(strResp, LIMIT) bDone = True Else strDefault = strResp End If Else bDone = True End If Loop
I guess I haven't posted anything interesting here for a while...