| From: sarah | E-mail: shakingmyass@hotmail.com | 1 |
Date: Saturday, December 8, 2001 at 19:45:46
Subject: message box
Comments:
Hi,
I'm working on a game using vb. I want to display a message box saying eg.
"You got the question right, fred" I want it to display the message
and the user name. I used a textbox for the user to type in there name.(TxtName)
It doesn't seem to work, it keep on saying invalid qualifier. Can you help
please?
Thank you.
Private Sub cmdSubmit_Click()
Dim response As Integer
If optAnswer(CorrectAns).Value =
True Then
response = MsgBox("Correct"&TxtName.text&)
Else
response = MsgBox("Wrong")
End If
Hide
End Sub
| From: Martin Allen | E-mail: <No e-mail> | 2 |
Date: Sunday, December 9, 2001 at 18:27:40
Subject: RE: message box
Comments:
The first thing I noticed was that on the fourth line, you have:
MsgBox("Correct"&TxtName.text&)
this needs to be like this:
| MsgBox("Correct" & TxtName.Text) |
Also, on the third line you have the function
optAnswer(Corrections)
If this function returns a boolean, then you don't need
.Value
after it.
| From: sarah | E-mail: shakingmyass@hotmail.com | 3 |
Date: Sunday, December 16, 2001 at 20:42:03
Subject: RE: message box
Comments:
I tried out your solution, it still didn't work. It displayed invalid qualifier. What does that mean?
| From: Martin Allen | E-mail: <No e-mail> | 4 |
Date: Monday, December 17, 2001 at 19:31:30
Subject: RE: message box
Comments:
Send me the project and I will have a look at it.
| From: Otniel | E-mail: otnielo@excite.com | 5 |
Date: Friday, April 12, 2002 at 05:15:51
Subject: RE: message box
Comments:
You should try giving the value to the "Response" variable before using the If statement. I hope this helps
| From: Suvathana So (65.140.32.---) | E-mail: sosuvathana@hotmail.com | 6 |
Date: Wednesday, August 14, 2002 at 18:52:26
Website: http://vathana.topcities.com/
Subject: RE: message box
Comments:
I see what's wrong, it's because you idenfitied the variable "response" as integer, try to put this "Dim response" instead of "Dim response as Integer" Hope it will help.
| From: rick (195.195.239.---) | E-mail: rwrw80@hotmail.com | 7 |
Date: Thursday, August 22, 2002 at 20:30:34
Subject: RE: message box
Comments:
I think you need to make up the message in a string before giving it to msgbox. try this... msg="Correct" & TxtName.text msgBox (msg)
This forum is no longer taking new messages or replies since 01 November 2002. The above material is for reference purposes only.
The new Visual Basic 6.0 forum can be found here.