Jx_Man 987 Nearly a Senior Poster Featured Poster

I need to know how i can make a button open a second form in my project

Private Sub Command1_Click()
Form2.Show
End Sub

I also need to know how to open notepad with a button

Private Sub Command1_Click()
    Dim dTaskID As Double, path As String, file As String
    path = "C:\WINDOWS\notepad.exe"
    Shell path, vbNormalFocus
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Gibbie...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the problem now?

Jx_Man 987 Nearly a Senior Poster Featured Poster
string s;
s = textBox1.Text.Length.ToString();
Jx_Man 987 Nearly a Senior Poster Featured Poster

This following code just allowed you to entered numbers only (No alphabetics or any special characters) :

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
              Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
            e.Handled = True
    End If
    If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
            e.Handled = False
    End If
End Sub

This following code just allowed you to entered strings / alphabetics only (no numbers or any special characters):

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
        If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _
            Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _
            And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _
            Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then
            'Allowed space
            If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
                e.Handled = True
            End If
        End If
        ' Allowed backspace
        If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
            e.Handled = False
        End If
End Sub
ITKnight commented: lets talk about powerfull code of you. great man +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what condition to exit?

Jx_Man 987 Nearly a Senior Poster Featured Poster

use this following function :

Public Function Factorial(ByVal Number As Integer) As String
        Try
            If Number = 0 Then
                Return 1
            Else
                Return Number * Factorial(Number - 1)
            End If
        Catch ex As Exception
            Return ex.Message
        End Try
    End Function

I called this function in button click event:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
       Dim num As Integer
        num = Val(InputBox("Enter the Factorial Number"))
        MsgBox(Factorial(num))
End Sub
Vega_Knight commented: Help me... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)
Please post your help in current section.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

great code.
just to correct ;)

newString = newString & "'" & MyArr(i) & "'," & vbCrLf
Jx_Man 987 Nearly a Senior Poster Featured Poster

HI...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Thanks for the share friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Yes u can, i think selvaganapathy was given the best answer :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

never tried= never know is my Signature. Always shown when i posted something.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Nice to help

Jx_Man 987 Nearly a Senior Poster Featured Poster

Microsoft Chart Control 6.0 (SP4)

november_pooh commented: thank you +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Year.Text < Now.Year Then
            MsgBox("Cannot input past year")
        ElseIf Year.Text = Now.Year Then
            If Trim(Month.Text) < Now.Month Then
                MsgBox("Cannot input past month")
            End If
        End If
    End Sub
november_pooh commented: Helping me +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)
>>a very nice site!!!
Absolutely Right :D

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi dustypc...Welcome to Daniweb Friend :)
Hi gcizoo...Please post your question on current section, this section for introduction only.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

If this question already solved please mark thread to Solved :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

he mean to post your question in Database Section also.

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're Welcome
Happy coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

you're Welcome
Happy coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the problem is?show me your effort...
any error occured?

Jx_Man 987 Nearly a Senior Poster Featured Poster

yes, please give a feedback

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)