Jx_Man 987 Nearly a Senior Poster Featured Poster

but their is an error saying that it is invalid password

It means your password in connection is wrong.
change this MyDbPassword with your own password.

Jx_Man 987 Nearly a Senior Poster Featured Poster

It should be like this :

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;

For more information see this site

Jx_Man 987 Nearly a Senior Poster Featured Poster

Using what db?
post your connection code.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Public Function ChangeFileExt(ByVal FileName As String, ByVal Extention As String)
 Dim str() As String, NewFile As String
 If InStr(1, FileName, ".") Then
     str = Split(FileName, ".")
     NewFile = Replace(FileName, str(UBound(str)), Extention)
     Name FileName As NewFile
 Else
     Name FileName As FileName & "." & Extention
 End If
End Function

Private Sub Command1_Click()
Call ChangeFileExt("D:\test.jx", "txt")
End Sub

Or you can use another technique in this post

Sawamura commented: Awesome!!!! +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help :

Private Sub ListFiles(strPath As String, Optional Extention As String)
'Leave Extention blank for all files'
    Dim File As String

    If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"

    If Trim$(Extention) = "" Then
        Extention = "*.*"
    ElseIf Left$(Extention, 2) <> "*." Then
        Extention = "*." & Extention
    End If

    File = Dir$(strPath & Extention)
    Do While Len(File)
        List1.AddItem File
        File = Dir$
    Loop
End Sub

Private Sub Command1_Click()
    ListFiles "D:\musicfolder", "*" 
    ' Or ListFiles "D:\musicfolder", "" leave it blank to get all files'
End Sub

See this thread

Sawamura commented: Worked nice :) +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Private Sub ClearCombo(ByVal MyCombo As ComboBox)
    MyCombo.Clear
End Sub

Private Sub ClearCombo_Click()
Dim Temp As Control
For Each Temp In Me.Controls
    If TypeOf Temp Is ComboBox Then
        Temp.Text = ""
        ClearCombo Temp
    End If
Next
End Sub
Sturdy commented: Solved +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try :

Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
    Dim i As Integer = DataGridView1.CurrentRow.Index
    txttID.Text = DataGridView1.Item(0, i).Value
    txttSurname.Text = DataGridView1.Item(1, i).Value
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

To limit your retrieved data from database you use TOP clause in your sql statement.
You can read in this site.

Select TOP 50 * from Customers
Sturdy commented: Worked Perfectly +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Can you show your sql query to retrieve customers from database?

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help :

    Function pathOfFile(fileName As String) As String
        Dim posn As Integer
        posn = InStrRev(fileName, "\")
        If posn > 0 Then
            pathOfFile = Left$(fileName, posn)
        Else
            pathOfFile = ""
        End If
    End Function

Call it using Shell() Function :

Private Sub Command1_Click()
    Dim myPath As String
    myPath = "D:\Dani\result.png"
    Shell "explorer " & pathOfFile(myPath)
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Use looping to read all data.

While (acsdr.Read())
ComboBox2.Items.Add(acsdr("Sections"))
End While
november_pooh commented: True +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Yes, You need to download the ODBC connector.
Here is the link :
http://dev.mysql.com/downloads/connector/odbc/5.1.html#win32

Naruse commented: Thanks +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

below is my vb6.0 code. the click command is to save my text and picture. there is no problem for my text. but, i have a problem after saving the picture. the picture can be saved but it is not availabe for preview. is there any fix for this ?

To save picture in PictureBox you should use SavePicture() function :

Dim namefile2
namefile = App.Path & ("/" & Text1 + Text2) & ".bmp"
SavePicture Picture1.Image, namefile
dnk commented: :D +1
Neji commented: - +1
debasisdas commented: agree +13
Jx_Man 987 Nearly a Senior Poster Featured Poster

Good. :D
Don't Forget to mark this thread as Solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Unload Me
End If
End Sub
Estella commented: helper +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

like this ?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    TextBox1.Enabled = False
    ComboBox1.Enabled = False
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

I don't get what you want to exactly.
Please more specify.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome. :D
Don't forget to mark this thread as Solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Why you don't put it in one form_load?
Make a procedure or function for each code and call it on form_load.

Private Sub waveform_picture_code ()
  'waveform picture code
End Sub
Private Sub rfid_code ()
  'rfid code
End Sub
Private Sub Form_Load()
    waveform_picture_code
    rfid_code
End Sub
alapeh commented: useful and work! +0
Naruse commented: Good +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

What you mean two form load work together? these two from load are coming from same Form or different Form?

Jx_Man 987 Nearly a Senior Poster Featured Poster

You can set radio button checked as True in Radio button properties.
Or you can set it manually :

RadioButton1.Checked = True 'RadioButton1 set as default
    Combobox1.SelectedIndex = 0 'First item of combobox set as default
huskarit commented: Very nice! thanks Jx_Man +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help.
This following code will merge multiple text files into one file :
Add reference : Microsoft Scripting Runtime

Private Sub ConcatenateFiles(ByVal ResultFile As String, ByVal Separator As String, ParamArray SourceFiles() As Variant)
    Dim FSO As New FileSystemObject
    Dim fsSourceStream As TextStream
    Dim fsResStream As TextStream
    Dim sSeparator As String
    Dim i As Integer
    On Error Resume Next
    ' create a new file
    Set fsResStream = FSO.OpenTextFile(ResultFile, ForWriting, True)
    ' for each source file in the input array
    For i = 0 To UBound(SourceFiles)
        ' add the separator first (replacing the special tag for the file path)
        sSeparator = Replace(Separator, "#FilePath#", SourceFiles(i))
        fsResStream.Write sSeparator & vbCrLf
        ' open the file in read mode
        Set fsSourceStream = FSO.OpenTextFile(SourceFiles(i), ForReading)
        ' add its content + a blank line to the result file
        fsResStream.Write fsSourceStream.ReadAll & vbCrLf
        ' close this source file
        fsSourceStream.Close
    Next i
    fsResStream.Close
End Sub

Private Sub Command1_Click()
' Example:
 ConcatenateFiles "D:\res.txt", "------ NEW FILE: #FilePath# ------", "D:\1.txt", "D:\2.txt", "D:\3.txt"
End Sub
Sawamura commented: This is an awosome code :) +3
Estella commented: Absolutely Help +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

That works! Thanks, but your other code never worked. ( the first post)

You're Welcome. :D
Don't forget Mark this thread as Solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You are missing an

End If

after line 9

wow..really an eagle eyes :D

Jx_Man 987 Nearly a Senior Poster Featured Poster

Line 341 is causing the error:

that this code

Document.SelectionFont = New System.Drawing.Font(fontSelection.Text, Document.SelectionFont.Size, Document.SelectionFont.Style)

In your first post, you have two comboboxes for Font name and font size.
You said that you want to select a font size from combo box and apply it to richtextbox. But i didn't see it in your code. Did you tried my code?

Document.SelectionFont = New Font(ComboBox2.SelectedItem.ToString, CInt(ComboBox1.SelectedItem.ToString), Document.SelectionFont.Style)
Jx_Man 987 Nearly a Senior Poster Featured Poster

It cause your "rsLibrary" is not defined.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim btn As Control
        For Each btn In Me.Controls
            If TypeOf btn Is Button Then
                btn.ForeColor = Color.Blue
            End If
        Next
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    RichTextBox1.SelectionFont = New Font("Tahoma", CInt(ComboBox1.SelectedItem.ToString), RichTextBox1.SelectionFont.Style)
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're welcome. :D
Don't forget to mark this thread as solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Your code is fine. you just need to hide textboxes when form load. So, when your checkbox checked it will be visible :

private void Form1_Load(object sender, EventArgs e)
     {
        textBox4.Visible = false;
        textBox5.Visible = false;
     }
private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        if (checkBox1.Checked)
        {
            textBox$.Visible = true;
            textBox5.Visible = true;
        }
        else
        {
            textBox4.Visible = false;
            textBox5.Visible = false;
        }
    }
Jx_Man 987 Nearly a Senior Poster Featured Poster

An example :

Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
    Dim i As Integer = DataGridView1.CurrentRow.Index
    With DataGridView1
            If DataGridView1.Item(0, i).Value = "1" Then
                textbox1.text="hello"
            End If 
    End With
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

It because there is no SubItems(3) in your listview..
And why you show Owner ID twice in all of your codes?
modified as following "

Set lst1 = lvStudentInfo.ListItems.Add 
        With lst1
            .Text = rs!Owner_ID
            .SubItems(1) = rs!Owner_Name
            .SubItems(2) = rs!Owner_Address
          
        End With
Jx_Man 987 Nearly a Senior Poster Featured Poster

when i click on the command botton then it will show a
Run time error 52
if we delete this line to my coding
Err.Raise 52
then it will show Message (Msgbox "File recycled")
but cannot delete my file
please send me again code here is some problem so please tell me
what's wrong
what i do ?
Thanks

I'm sorry, I forgot to mention you to add reference.
Project-> Reference -> Microsoft Shell Controls and Automation
Also make sure that your files is exist.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome. :D
Dont forget to marh this thread solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Thanks Jx man
i am very thanks full to you.
you solve my problems many time. so Thanks you are a Genius.
Thanks alot

You're Welcome :)
Don't forget to mark this thread as solved. It will help another members who has same problem like you.

Thank you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Oh wait! i was not aware of this :-)
Thank you! let me try and see how it works!
Thank you again

Okay. Try it and give a feedback.
If you already managed it then post your code and mark this thread as solved.
It will help another member who has same problem like you. :)
Thank you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Okay since you need to copy-paste text in textbox 2, then i rewrite this code.
I assume you have 3 textboxes and 1 listbox to join all text.
Try this :

Private Sub Command2_Click()
    Dim myParas As Variant
    Dim i As Integer
    myParas = Split(Text2, vbNewLine)
    
    Dim a() As String
    a = Split(Text2, vbNewLine)

    For i = 0 To UBound(myParas)
        List1.AddItem Text1.Text & a(i) & Text3.Text
    Next
End Sub
Vega_Knight commented: Nice Code :D +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

what you mean exactly?
you want to use textbox instead of listbox?

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

Private Sub EnumFolders(fld As Object)
   Dim oShell As Object, fldItem As Object
   Dim i As Long
   On Error Resume Next
   Set oShell = CreateObject("Shell.Application")
   For Each fldItem In fld.Items
       If fldItem.IsFolder Then
          Call EnumFolders(fldItem)
       End If
       list1.AddItem fld.GetDetailsOf(fldItem, 0)
       
   Next
   Set fldItem = Nothing
   Set fld = Nothing
   Set oShell = Nothing
End Sub

Private Sub Command1_Click()
Dim oShell As Object
   Dim oRecycler As Object
   Set oShell = CreateObject("Shell.Application")
   Set oRecycler = oShell.NameSpace(10)
   EnumFolders oRecycler
End Sub
Naruse commented: Amazing... +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

API Declare :

Option Explicit

Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
 
Private Type SHFILEOPSTRUCT
    hwnd As Long
    wFunc As Long
    pFrom As String
    pTo As String
    fFlags As Integer
    fAnyOperationsAborted As Long
    hNameMappings As Long
    lpszProgressTitle As Long
End Type
 
Private Const FO_DELETE = &H3
Private Const FOF_ALLOWUNDO = &H40
Private Const FOF_NOCONFIRMATION = &H10
Private Const FOF_SILENT = &H4

Private Sub ShellDeleteOne(sFile As String)
 
  'set some working variables
   Dim shf As SHFILEOPSTRUCT
 
  'terminate the file string with
  'a pair of null charss
   sFile = sFile & vbNullChar & vbNullChar
 
  'set up the SHFile options
   With shf
      .wFunc = FO_DELETE  'action to perform
      .pFrom = sFile      'the file to act on
      .fFlags = 0& ' Delete permanent
      .fFlags = .fFlags + FOF_NOCONFIRMATION ' No confirm to delete
      .fFlags = .fFlags + FOF_SILENT
   End With
 
  'perform the delete
   Call SHFileOperation(shf)

End Sub

Delete File :

Private Sub Command1_Click()
    Call ShellDeleteOne("D:\junk.txt")
End Sub

Delete Folder :

Private Sub Command1_Click()
    Call ShellDeleteOne("D:\junk")
End Sub

Delete All Files (folders n files) in folder junk

Private Sub Command1_Click()
    Call ShellDeleteOne("D:\junk\*.*")
End Sub
Asitha_1 commented: Working correctly.. Thanks.. +0
Jx_Man 987 Nearly a Senior Poster Featured Poster

Set KeyPreview as True on form properties.
Then add this following code :

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'make sure KeyPreview is True on Form Properties
    'On Error Resume Next
    Select Case KeyCode
        Case vbKeyUp
            MsgBox "Up"
        Case vbKeyDown
            MsgBox "Down"
        Case vbKeyLeft
            MsgBox "Left"
        Case vbKeyRight
            MsgBox "Right"
    End Select
End Sub
luckynisarg commented: Good +0
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

Private Sub Recycle2(ByVal FQFileOrFolder As String)
    'Late bound.
    Dim Delim As Integer
    Dim FItem As Object
    Const ssfBITBUCKET = 10
    
    Delim = InStrRev(FQFileOrFolder, "\")
    With CreateObject("Shell.Application")
        For Each FItem In .NameSpace(Left$(FQFileOrFolder, Delim - 1)).Items
            If Not FItem.IsLink Then
                If UCase$(FItem.Name) = UCase$(Mid$(FQFileOrFolder, Delim + 1)) Then
                    .NameSpace(ssfBITBUCKET).MoveHere FItem
                    Exit Sub
                End If
            End If
        Next
    End With
    Err.Raise 52
End Sub

Private Sub Command1_Click()
    Recycle2 "D:\File.txt"
    Msgbox "File recycled"
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

I assume you use listbox for all controls :
You can use '&' ampersand sign to concatenate all items with same index for every listbox.
See this following code :

Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
    List4.AddItem List1.List(i) & List2.List(i) & List3.List(i) ' add items in list 1,2,3 to list 4
Next i
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help.

Add a timer, set interval to 1000 (or you can assign as you needed)
And use this following code :

Private Sub Timer1_Timer()
Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
End Sub
Sturdy commented: Perfect +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, you need to know what conditions when you have to send sms automatically.
If you already know it then use timer control to check the conditions and send a sms when you get same condition.

Jx_Man 987 Nearly a Senior Poster Featured Poster

thanks, it's help me...
@ jx man, how about using ActiveXpertsToolkit ...???
is that work like sms libx..???

See this.

Jx_Man 987 Nearly a Senior Poster Featured Poster
november_pooh commented: Great link +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome, Dude
Then please mark this thread solved

Jx_Man 987 Nearly a Senior Poster Featured Poster

See this following code :

For i As Integer = 0 To ListBox1.SelectedIndices.Count - 1
   ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
Next

Or you use this too :

Do While (ListBox1.SelectedItems.Count > 0)
   ListBox1.Items.Remove(ListBox1.SelectedItem)
Loop
kingsonprisonic commented: No Need of loop.... -1