Results 1 to 2 of 2

Thread: please help

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2012
    Posts
    1

    please help

    This program is not working in vb6. Could u please check where I am going wrong?. Thanks a lot
    <html>
    <head>
    <script language=”vbscript”>
    dim name, bd, g, age, n
    name=inputbox(“enter your name”)
    g=inputbox(“enter your gender”)
    bd=inputbox(“enter your birthdate in 4 digit year”)
    age=year(age)-year(bd)
    if age <= 15 then
    n=inputbox(“enter your school name”)
    elseif age>15 and age<=22 then
    n = inputbox(enter your college name”)
    elseif age>22 then
    n= inputbox (enter your workplace name”)
    end if
    document. write”<br> name:- “ &name
    document. write”<br> gendre;-“ & g
    document. write”<br> birth date:-“ &bd
    document. write” <br> other info:-“ &n
    </script>
    </head> </html>

  2. #2
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Smile Re: please help

    This program is not working in vb6. Could u please check where I am going wrong?. Thanks a lot .
    you have been trying in vbscript .try in the vb6 and in the following way.Hope this might help

    Code:
    Option Explicit
    
    Private Sub Form_Load()
    Dim bd As Date
    Dim Curyear As Date
    Dim age As Long
    Dim sName As String
    
    Curyear = CDate(InputBox("Please enter Current Year"))
    bd = Format(InputBox("Please enter your birthdate"), "DDMMYY")
    age = Year(Curyear) - Year(bd)
    MsgBox age
    If age <= 15 Then
      sName = InputBox("Enter school Name")
    ElseIf age > 15 And age <= 22 Then
      sName = InputBox("Enter CollegeName")
    ElseIf age > 22 Then
     sName = InputBox("Enter workplace Name")
    End If
    End Sub
    Last edited by firoz.raj; Feb 13th, 2012 at 04:46 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width