|
-
Jun 6th, 2001, 05:53 PM
#1
Thread Starter
Lively Member
InputBox problem. Need Help!
By using the following code, when I click on the CommandButton, it opens a second Form2 and also an InputBox.
The problem is that, when I click OK on the InputBox it is called again. Only after I close it a second time, it makes what I want: to put the text on a label on the second form.
Where am I wrong? Here's the code.
Option Explicit
Dim Notes As String
_____________________________________________________________________
Private Sub Command1_Click()
Form2.Show
Form2.Picture1.Picture = Command1.Picture
Notes = InputBox("Introduza o texto para esta nota do RoadBook")
If Form2.Visible = True Then
InputBox ("Introduza o texto para esta nota do RoadBook")
End If
Form2.Label1.Caption = Notes
End Sub
-
Jun 6th, 2001, 06:50 PM
#2
Frenzied Member
What Are you trying to do.
You are calling two times the inputbox Thats why its displayed two times.
Private Sub Command1_Click()
Form2.Show
Form2.Picture1.Picture = Command1.Picture
Notes = InputBox("Introduza o texto para esta nota do RoadBook")
If Form2.Visible = True Then
InputBox ("Introduza o texto para esta nota do RoadBook")
End If
Form2.Label1.Caption = Notes
End Sub
-
Jun 6th, 2001, 07:00 PM
#3
Thread Starter
Lively Member
Thanks for you reply shragel.
I want to put the "input text" on a label, on the Form2 (when I click OK on the inputbox, the text appears inside the label).
I think I need to declare a variable [notes = InputBox("Introduza o texto para esta nota do RoadBook")] so that I can insert the text inside the label (Form2.Label1.Caption = Notes).
Maybe this is wrong.
Can I use Form2.Label1.Caption = InputBox("Introduza o texto para esta nota do RoadBook")? This won't call the InputBox a second time again? How can I avoid that?
-
Jun 6th, 2001, 07:03 PM
#4
_______
<?>
Code:
Private Sub Command1_Click()
Form2.Show
Form2.Picture1.Picture = Command1.Picture
Notes = InputBox("Introduza o texto para esta nota do RoadBook")
'you don't need this cause you just make form2 visible with Form2 Show
'If Form2.Visible = True Then
'InputBox ("Introduza o texto para esta nota do RoadBook")
'End If
Form2.Label1.Caption = Notes
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 6th, 2001, 07:09 PM
#5
Thread Starter
Lively Member
Thanks for you reply Joe (may I call you just Joe?)
So you mean:
Private Sub Command1_Click()
Form2.Show
Form2.Picture1.Picture = Command1.Picture
InputBox ("Introduza o texto para esta nota do RoadBook")
Form2.Label1.Caption = InputBox ("Introduza o texto para esta nota do RoadBook")
End Sub
Is this correct?
-
Jun 6th, 2001, 07:13 PM
#6
_______
<?>
No & No
You can call me Wayne
& This will do.
Code:
Private Sub Command1_Click()
Form2.Show
Form2.Picture1.Picture = Command1.Picture
Form2.Label1.Caption = InputBox("Introduza o texto para esta nota do RoadBook")
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 6th, 2001, 07:21 PM
#7
Thread Starter
Lively Member
Ok, I see what you mean.
Thanks for your help, Joe Wayne (sorry for that, I could not resist)
Thanks again.
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
|