|
-
Nov 3rd, 2000, 09:35 PM
#1
Thread Starter
Lively Member
I am lost on this. I need to add what is added in an InputBox to a textbox on a form and to a field in a database. I want to have OK and Cancel. How can I check for Cancel and get the value?
Code:
Dim iResponse As Integer
iResponse = InputBox "Add Note"
If iResponse = 1 Then 'user hit Ok
'this will check for the cancel but how do I get
'the data entered
Dim strNote As String
strNote = InputBox("Enter Note for" & ListView1.SelectedItem, "Add Note")
'this get the data but not the Cancel
'How do I do this?
-
Nov 3rd, 2000, 09:45 PM
#2
add an if...
Code:
if (strNote <> "") then
'whatever
end if
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 3rd, 2000, 09:46 PM
#3
Code:
Dim iResponse As Integer
iResponse = InputBox "Add Note"
If iResponse = 1 Then 'user hit Ok
'this will check for the cancel but how do I get
'the data entered
Dim strNote As String
strNote = InputBox("Enter Note for" & ListView1.SelectedItem, "Add Note")
If strNote = "" Then Msgbox "Nothing entered!", vbCritical
'....
-
Nov 3rd, 2000, 09:58 PM
#4
Thread Starter
Lively Member
only one inputbox
I may have made my question a little confusing. I only want one InputBox to show up. I need to know if I can check the button and get the string. If not I can work around it. I just wanted to check the cancel button in case the user entered something then changed thier mind.
-
Nov 3rd, 2000, 10:01 PM
#5
if the user hits cancel, the string will be empty, so mine, or Matthew's code will work.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 3rd, 2000, 10:04 PM
#6
I see what you want.
Code:
x = InputBox("How are you today?")
If x <> "" Then
Msgbox "Response: " & x
Else
Msgbox "Not having a good day?"
End If
-
Nov 3rd, 2000, 10:15 PM
#7
_______
<?>
this is all you need.
Dim strNote As String
strNote = InputBox("Enter Note for" & ListView1.SelectedItem, "Add Note")
If strNote = "" Then
MsgBox "You either picked nothing or pressed cancel"
Exit Sub
End If
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|