Jx_Man 987 Nearly a Senior Poster Featured Poster

you're welcome :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

use Like operan better than = operan

Jx_Man 987 Nearly a Senior Poster Featured Poster

use tab index to set cursor on current text box.
setfocus cannot be called in form load. just in procedure or function.

Vega_Knight commented: right +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

ermm.. if use the combo box, how we can link the date to database.. mean 1st combo for day, 2nd for month and 3rd for year rite?? so, how to combine this 3 combo in database.. what the source code, the sql..

why don't use datetimepicker..

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

There are million example on Google. find it first, try it, debug it and see if it works or not. if that example not working than u can post your problem in this forum. we can directing you but not write all codes for you.
people/company will pay u with an expensive price just for displaying "Hello World" cause they didn't know how to do that. so please do something before post your problem except you will pay people who answer your problem.

Jx_Man 987 Nearly a Senior Poster Featured Poster

see this code :
add this code to Module :

Module Module1
    Public Sub AutoComplete(ByVal cbo As ComboBox, ByVal e As System.Windows.Forms.KeyEventArgs)
        Dim iIndex As Integer
        Dim sActual As String
        Dim sFound As String
        Dim bMatchFound As Boolean

        If Not cbo.Text = "" Then 'if the text is not blank then only proceed

            If e.KeyCode = Keys.Back Then
                cbo.Text = Mid(cbo.Text, 1, Len(cbo.Text) - 1)
            End If

            If ((e.KeyCode = Keys.Left) Or _
             (e.KeyCode = Keys.Right) Or _
             (e.KeyCode = Keys.Up) Or _
             (e.KeyCode = Keys.Down) Or _
             (e.KeyCode = Keys.PageUp) Or _
             (e.KeyCode = Keys.PageDown) Or _
             (e.KeyCode = Keys.Home) Or _
             (e.KeyCode = Keys.End)) Then
                Return
            End If


            Do

                sActual = cbo.Text

                iIndex = cbo.FindString(sActual)
                If (iIndex > -1) Then '** FOUND SECTION **

                    sFound = cbo.Items(iIndex).ToString()
                    ' Select this item from the list.

                    cbo.SelectedIndex = iIndex
                    cbo.SelectionStart = sActual.Length
                    cbo.SelectionLength = sFound.Length
                    bMatchFound = True
                Else '** NOT FOUND SECTION **

                    If sActual.Length = 1 Or sActual.Length = 0 Then
                        cbo.SelectedIndex = 0
                        cbo.SelectionStart = 0
                        cbo.SelectionLength = Len(cbo.Text)
                        bMatchFound = True

                    Else
                        cbo.SelectionStart = sActual.Length - 1
                        cbo.SelectionLength = sActual.Length - 1
                        cbo.Text = Mid(cbo.Text, 1, Len(cbo.Text) - 1)
                    End If

                End If

            Loop Until bMatchFound

        End If

    End Sub
End Module

Add this code to form :

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ComboBox1.Items
            .Add("Jery")
            .Add("Victor")
            .Add("fitri")
            .Add("Sari")
            .Add("Dewi")
            .Add("Denok")
        End With

    End Sub

    Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles …
Jx_Man 987 Nearly a Senior Poster Featured Poster

Private Sub Command2_Click()
Call clear
End Sub

Public Sub clear()
Dim txt As Control
For Each txt In Controls
If TypeOf txt Is TextBox Then
txt.Text = ""
End If
Next

your code for vb 6 sonia :)

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

add this code to module to connected sqlserver with vb.net:

Imports System.Data
Imports System.Data.SqlClient

Module Koneksi
    Public conn As SqlConnection
    Public Function GetConnect()
        conn = New SqlConnection("server = MyServerName;database = MyDatabaseName;Trusted_Connection = yes")
        Return conn
    End Function
End Module

add this code to button event click :

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        Dim check As Integer
        Dim conn As SqlConnection
        Dim cmdStudent As New SqlCommand
        Dim cmdStudent1 As New SqlCommand
        Dim daStudent As New SqlDataAdapter
        Dim dsStudent As New DataSet
        Dim dtStudent As New DataTable

        If txtId.text = "" Or txtFirstName.Text = "" txtLastName.Text = "" Or txtAge.Text = "" Then
            MsgBox("Student Data is not completed", MsgBoxStyle.OKOnly)
        Else
            If MsgBox("Are you sure to save Student data with Id : " & txtId.text & " ?", MsgBoxStyle.OKCancel, "Input confirm") = MsgBoxResult.Cancel Then
                ' do nothing
            Else
                Try
                    conn = GetConnect()
                    conn.Open()
                    cmdStudent = conn.CreateCommand
                    cmdStudent.CommandText = "SELECT * FROM Student WHERE Id='" & Trim(txtId.text) & " ' "
                    daStudent.SelectCommand = cmdStudent
                    daStudent.Fill(dsStudent, "Student")
                    dtStudent = dsStudent.Tables("Student")

                    If (dtStudent.Rows.Count > 0) Then
                        MsgBox("Student dengan Id " & Trim(cmbId.Text) & " already in database", MsgBoxStyle.OKOnly, "Message :")
                    Else
                        
                        cmdStudent1 = conn.CreateCommand
                        cmdStudent1.CommandText = "INSERT INTO Student(Id, FirstName, LastName,Age) VALUES('" & Trim(txtId.text) & "','" & Trim(txtFirstName.Text) & "','" & Trim(txtLastName.Text) & "','" & Trim(txtAge.Text) & "')"
                        check = cmdStudent1.ExecuteReader.RecordsAffected()
                        If check > 0 Then
                            MsgBox("Student With Id " & Trim(cmbId.Text) & " succesfully to added", MsgBoxStyle.OKOnly, "Message :")
                        Else
                            MsgBox("Student With Id " & Trim(cmbId.Text) …
november_pooh commented: Nice code +1
ITKnight commented: how great this code :) +1
Vega_Knight commented: nice one... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

yes, absolutely right. this forum is a great place to learn. btw welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

i confused when i read your code?
what exactly you want to do?

Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click
' calls a procedure to calculate the total and average
' rainfall amounts, then displays both amounts

Static rainCounter As Integer
Static rainAccum As Decimal
Dim avgRain As Decimal

Call CalcTotalAndAverage(rainCounter, rainAccum, avgRain)

Me.xTotalLabel.Text = rainAccum.ToString("N2")
Me.xAverageLabel.Text = avgRain.ToString("N2")

Me.xMonthlyTextBox.Focus()
Me.xMonthlyTextBox.SelectAll()
End Sub

see your part code above.
- you call CalcTotalAndAverage but you don't have a value for rainCounter and rainAccum.

- your procedure parameter is wrong.

Private Sub CalcTotalAndAverage(ByVal rainCounter As Integer, _
ByVal rainAccum As Decimal, _
ByVal avgRain As Decimal)
rainAccum = rainCounter
avgRain = (rainAccum / rainCounter)
End Sub

avgRain is not input but a result of dividing.. so you cannot set it as input. declare this variable inside of procedure.
it must be :

Private Sub CalcTotalAndAverage(ByVal rainCounter As Integer,                                     ByVal rainAccum As Decimal)
        [B]Dim ByVal avgRain As Decimal[/B]
        rainAccum = rainCounter
        avgRain = (rainAccum / rainCounter)
    End Sub

Actually i don't understand your program. please explain more detail what you want to do.

Jx_Man 987 Nearly a Senior Poster Featured Poster

# To add a Date Time Picker control, on the Toolbox, click the More Controls button
# Scroll down in the list of controls, click Microsoft Date and Time Picker 6.0 (SP4), and click the form.
see this tutorial

Jade_me commented: great link +1
november_pooh commented: Yesh +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

try this code :

Private Sub Form_Load()
Dim RS As ADODB.Recordset
    Dim Conn As ADODB.Connection
    Dim Comm As ADODB.Command
    Dim str As String
    
    Set Conn = New ADODB.Connection
    Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = D:\Only Me\Authors.mdb"
    Conn.Open
    Set Comm = New ADODB.Command
    Set Comm.ActiveConnection = Conn
    Comm.CommandText = "SELECT Au_ID FROM Authors"
    Comm.CommandType = adCmdText
    Set RS = Comm.Execute
    
    Do Until RS.EOF = True
        Combo1.AddItem RS!Au_ID
    RS.MoveNext
    Loop
     
    Set RS = Nothing
    Set Comm = Nothing
    Set Conn = Nothing
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

i tried this with 2 listbox and 1 button. i was moved item on list2 to list5 and remove current item after moved.

Private Sub Form_Load()
With List2
    .AddItem ("1")
    .AddItem ("2")
    .AddItem ("3")
End With
Private Sub Command4_Click()
List5.AddItem List2.ItemData(List2.ListIndex)
List2.RemoveItem List2.ItemData(List2.ListIndex)
End Sub
End Sub
leedsy7 commented: always very helpfull:) +1
Neji commented: helpfull +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

everything is possible. In vb 6 you can direct access value from another form of any control (example is done by veena) but in .net you will find encapsulated form.

Jx_Man 987 Nearly a Senior Poster Featured Poster

use BLOB

Jx_Man 987 Nearly a Senior Poster Featured Poster

thats in indonesia right?

yes, absolutely right. :)
i m from Indonesia.

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 Lauren...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

Name : Jery
NickName : Jx_Man
Age : 22
Hobbies : Soccer,Basketball,Swimming, Loved Sport Much.
Location : Jogjakarta
Occupation : Last year University Student

i m still post around Geek Lounge, vb, vb.net, C# (sometimes) section.

Thanks...

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi..Welcome to Daniweb Friend :)
Hope you see around and help others

Jx_Man 987 Nearly a Senior Poster Featured Poster

try this :

Label1.Text = Microsoft.Visualbasic.Mid("November"3,3)
november_pooh commented: works like a charm +1
Neji commented: awesome +1
ITKnight commented: Great +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

use Microsoft Multimedia Control. find this control on component.
add this code to play mp3 file :

On Error GoTo ErrMsg
AxMMControl1.Wait = True
AxMMControl1.FileName = OpenFileDialog1.FileName
AxMMControl1.Command = "Open"
AxMMControl1.Command = "Play"
Exit Sub
ErrMsg:
     MsgBox(Err.Description)
End Sub
Naruse commented: thx +1
Sawamura commented: uhuy +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

oh...i was done it. i able to save it. really basically. i write a file name with a types on FileName box (test.rb) ans save it then Go option appeared. so i can compile it.
thanks for your help pty...

Jx_Man 987 Nearly a Senior Poster Featured Poster

how can i save my project in .rb type?
please read my first post for my first question.
i can't to save project as any type cause there are none types appear when i tried to saved it.
see for an attachment, there are pic for my save dialog.
i m sorry for this newbie question :)
Please help.
Jery

Jx_Man 987 Nearly a Senior Poster Featured Poster

veena answered it. but you also can do with selected item :

If Combo1.SelectedItem = "What" Then
    Textbox1.Enable = False
Else
    Textbox1.Enable = True
End If
Jx_Man 987 Nearly a Senior Poster Featured Poster

Actually i never take a class, learn vb by my self. Search on google for a tutorials or e-books and try it. if get something problem then posting it in this forum.
Happy coding friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Also you can do with this code :

Private Sub txtBahasa_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtBahasa.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
            'space accepted
            If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
                e.Handled = True
            End If
        End If
        If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
            e.Handled = False
        End If

    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi Dan...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

Hi...Welcome to Daniweb Friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Maybe she want to found something that it has a connection with this site...
Don't worry...what she can do here is always about computer, programming, technology, what else... :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

yeah, post a code more help.
i'll waiting your code.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Search on Google :)
Visit this link

dnk commented: Great Link +1
Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Function ReturnNbrOfSelectedDataGridRows(ByVal dgSearchResults As DataGrid) As Integer
    Dim cm As CurrencyManager = DirectCast(Me.BindingContext(Me.dgSearchResults.DataSource, Me.dgSearchResults.DataMember), CurrencyManager)
    
    Dim dv As DataView = DirectCast(cm.List, DataView)
    
    Dim iRowCount As Integer = 0
    For i As Integer = 0 To dv.Count - 1
        
        If Me.dgSearchResults.IsSelected() Then
            iRowCount += 1
        End If
    Next
End Function
Jx_Man 987 Nearly a Senior Poster Featured Poster

what u mean with e-mail button?

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the problem with storing in variable???

total1 = textbox1.text
total2 = textbox2.text
sign = combobox1.SelectedItem
november_pooh commented: he didn't understand what the problem is... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

- Make MDI Parent
Set On Form properties (form that u want it be a parent)
IsMdiContainer = True

- Make MDI Child
Add this Code when you call new form as a child, ex :

Private Sub MenuSubNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuSubNew.Click
Dim NewMDIChild as New Form2()

'Make form 1 (this form) as Parent in MDI Child
NewMDIChild.MdiParent = Me
' Show form2 as child
NewMDIChild.Show()
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

did u have the search function before?
use like operator in your search clause..

Jx_Man 987 Nearly a Senior Poster Featured Poster

share the answer please, so if someone get a same problem he can solved it.
thanks friend :)