Can we display only integers / numbers through the message
box? Is there any constraint to do so?

Answer Posted / hemal1972

yes, we can display only integers/numbers through the
message box. following is the code.

'code starts here
'declaring variable which holds integer number.
dim intA as integer
'declaring variable which holds string value
dim strB as string

'now, if we have textbox control in which we enter the
value of any number which may or may not be integer.

intA=cint(val(text1.text))'text1 is name of textbox
control.
strB= cstr(intA)
msgbox strB,vbokonly,"here is integer number"
'code ends here.

paste this code in command1_click event in the form which
contains textbox control text1 and commandbutton control
command1.run the program. enter any number in textbox,
click command1 and see the result in message box. thanks.


Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I mimic a toggle button?

1016


How to find the current record position in data control?

1451


What is recordset in visual basic?

575


Explain about Caturing Baseline.

642


___ is the control used to call a windows application.

1084






What are the tools in visual basic?

513


What is ActiveX Control?

1764


How can I create a VBX?

1096


1s it posible to Create Tables Through Querydef?

1716


What is the use of parameters collection?

1552


What is the default workspace?

1645


What is the use of Visual Basic Document file?

1914


Explain about creating VB applications in excel?

678


What is ODBC Direct and Microsoft Jet Database Engine ?

1870


How to use hyperlink?

594