Jx_Man 987 Nearly a Senior Poster Featured Poster

what u mean about 6 data here?
6 rows added when you click add or 6 data (6 fields) in on row?

sql = "insert into Pengurus(name, staff no.,items, quantity, date )" & "values ('" & txtQtt.Text & "', '" & txtDate.Text & "') "

in your sql statment you just insert 2 value there..
also you want to insert data from combo box? so in your combo box just contain 6 items ? if less or more than 6 items in combobox which item that u want to insert?
and you want insert from which combo box to what field?

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :
1. Add textbox to form name it as textAddress
2. Add Component, Project->Component (Or Ctrl+T), Find for Microsoft Internet Controls, check and Apply it. you can find a new control appear on toolbox named Webbrowser.
3. Add WebBrowser to Form.
4. Add Timer to form, set Interval to 1000 (1000 = 1 Second)
5. Add this following code :

Dim i As Integer
Private Sub Form_Load()
WebBrowser1.Navigate ("http://www.yahoo.com")
textAddress.Text = ("http://www.yahoo.com")
Timer1.Enabled = True
i = 0
End Sub

Private Sub Timer1_Timer()
i = i + 1
List1.AddItem i
If i = 10 Then 
    WebBrowser1.Navigate ("http://www.google.com")
    textAddress.Text = ("http://www.google.com")
End If
If i = 20 Then ' 
    WebBrowser1.Navigate ("http://www.amazon.com")
    textAddress.Text = ("http://www.amazon.com")
End If
If i = 30 Then
    WebBrowser1.Navigate ("http://www.facebook.com ")
    textAddress.Text = ("http://www.facebook.com")
End If
If i = 40 Then
    End 
End If

End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

I can't understand clearly. post more information.
Post the code you've been work.

Jx_Man 987 Nearly a Senior Poster Featured Poster

no..you even didn't show some effort after i give u a link.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You didn't need "do..loop" in calc button click event. Just remove it.

Jx_Man 987 Nearly a Senior Poster Featured Poster
ITKnight commented: Complete Guide +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

First, you are kind of lazy one. We only give homework help to those who show effort.

Visit this site and this site to see tutorial to make web browser with vb6.
Or Do some googling to find something out.

Jx_Man 987 Nearly a Senior Poster Featured Poster

MySQL. its free to use.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Your're Welcome..
Please Mark your thread as solved..
you can find the link below the posts.

Jx_Man 987 Nearly a Senior Poster Featured Poster

well your code its working to me.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Set Picture1.Picture = Nothing

Don't forget to mark this thread as solved :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're welcome.
Happy Coding :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

See this attachment.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're welcome friend..
Happy coding.

Jx_Man 987 Nearly a Senior Poster Featured Poster

There are many way to accomplish this.
See if this help :

' Get a free file number
nFileNum = FreeFile

' Open a text file for input. inputbox returns the path to read the file
Open "D:\test.txt" For Input As nFileNum
lLineCount = 1
' Read the contents of the file
Do While Not EOF(nFileNum)
   Line Input #nFileNum, sNextLine
   'do something with it
   'add line numbers to it, in this case!
   sNextLine = sNextLine & vbCrLf
   sText = sText & sNextLine

Loop
Text1.Text = sText
' Close the file
Close nFileNum
november_pooh commented: Really Quick Solution.. thx jx +3
Vega_Knight commented: This a good stuf :) +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

try it and let see how it works..

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help.
This following example code is how to save image path into mysql:

Button Browse used to select an image and show the path to lblPath.

Private Sub btnBrowse_Click()
CommonDialog1.Filter = "All files (*.*)|*.*"
CommonDialog1.DialogTitle = "Select File"
CommonDialog1.ShowOpen

lblPath.Caption = CommonDialog1.FileName ' label path to show path of image
End Sub

Button Save used to store data into database.

Private Sub btnSave_Click()
With Adodc1
    .Refresh
    .Recordset.AddNew
    .Recordset.Fields("IdAddress") = txtIdAddress.Text
    .Recordset.Fields("First_Name") = txtFirstName.Text
    .Recordset.Fields("Last_Name") = txtLastName.Text
    .Recordset.Fields("Phone_Num") = txtPhoneNumber.Text
    .Recordset.Fields("Email") = txtEmail.Text
    .Recordset.Fields("PhotoPath") = lblPath.Caption ' This field will save path of selected image from common dialog.
    .Recordset.Update
End With
    MsgBox "Data Added"
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

first, how you design your database?
what fields that you have?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Add reference : Microsoft CDO For Windows 2000 Library
5 textboxes, 1 button
Try This :

Private Sub Command1_Click()
    
    On Error GoTo ErrHandler
    
    Dim oConfig As New CDO.Configuration
    Dim oMsg As New CDO.Message
    
    Label1.Caption = ""
    
    With oConfig.Fields
       .Item(cdoSendUsingMethod) = cdoSendUsingPort
       .Item(cdoSMTPServerPort) = 465
       .Item(cdoSMTPServer) = "smtp.mail.yahoo.com"
       .Item(cdoSMTPAuthenticate) = cdoBasic
       .Item(cdoSendUserName) = txtSender.Text
       .Item(cdoSendPassword) = txtPassword.Text
       .Item(cdoSendEmailAddress) = txtSender.Text
       .Item(cdoSMTPUseSSL) = 1
       .Update
    End With
    
    With oMsg
       .Configuration = oConfig
       .Subject = txtSubject.Text
       .To = txtAddress.Text
       .From = txtSender.Text
       .HTMLBody = txtMessage.Text
       .Send
    End With
    
    Set oMsg = Nothing
    Set oConfig = Nothing
    
    Label1.Caption = "Email Sent"
    Exit Sub

ErrHandler:

    MsgBox Err.Description, vbCritical, "Error"

End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Add reference : Microsoft CDO For Windows 2000 Library
5 textboxes, 1 button
Try This :

Private Sub Command1_Click()
    
    On Error GoTo ErrHandler
    
    Dim oConfig As New CDO.Configuration
    Dim oMsg As New CDO.Message
    
    Label1.Caption = ""
    
    With oConfig.Fields
       .Item(cdoSendUsingMethod) = cdoSendUsingPort
       .Item(cdoSMTPServerPort) = 465
       .Item(cdoSMTPServer) = "smtp.mail.yahoo.com"
       .Item(cdoSMTPAuthenticate) = cdoBasic
       .Item(cdoSendUserName) = txtSender.Text
       .Item(cdoSendPassword) = txtPassword.Text
       .Item(cdoSendEmailAddress) = txtSender.Text
       .Item(cdoSMTPUseSSL) = 1
       .Update
    End With
    
    With oMsg
       .Configuration = oConfig
       .Subject = txtSubject.Text
       .To = txtAddress.Text
       .From = txtSender.Text
       .HTMLBody = txtMessage.Text
       .Send
    End With
    
    Set oMsg = Nothing
    Set oConfig = Nothing
    
    Label1.Caption = "Email Sent"
    Exit Sub

ErrHandler:

    MsgBox Err.Description, vbCritical, "Error"

End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

what error? can u post your Loader code?
Are you want to preview clerk and manager in one listview or preview on each listview?
As debasisdas said if you want to show both of them in one listview then you need to join using SQL.

Jx_Man 987 Nearly a Senior Poster Featured Poster

ok, i have this code:

If Text1 = KeyPress Then
Label = CommonDialog1.FileName
End If

but i have an error with KeyPress event :C

This not a code i asking for..
I asked your code for save or load data from database.
or you didn't have a code for save or load data?
and for your code how you can assign a textbox with keypress ? and you try to get file name without select it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You put the item on text box?
Put it on listbox. it make you easier to input multiple data on listview.

Jx_Man 987 Nearly a Senior Poster Featured Poster

combine to what?
to preview in which listview?

Jx_Man 987 Nearly a Senior Poster Featured Poster

You said that you only can preview data on data grid when you load your form.
So the code that you using to preview data at load form, make it like procedure/function.
You just call the function to refresh datagrid from anywhere.
After insert, edit or delete data or on refresh button.

Just put your preview code into procedure/function

Public Sub RefreshDataGrid()
   ... 'Your query to preview data on datagrid
End Sub

You can call that procedure at any event to refresh data grid

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
    ... 'your code to insert data
    RefreshDataGrid ' call refreshdatagrid function to refresh data on datagrid after insert statment
End Sub

Do the same thing for edit or delete event or refresh button.

Jx_Man 987 Nearly a Senior Poster Featured Poster

how to make datagrid automaticly load data form database after insert new data..data grid only load after i relaunch my application...do i need create refresh button or anything else??

I suggest to make a function to preview data. so you can call it anywhere. after insert, edit or delete data or refresh button .

Jx_Man 987 Nearly a Senior Poster Featured Poster

as debasisdas said, use common dialog control

First you need to add the component:
* Project > Components
* On the Controls tab, choose Microsoft Common Dialog Control 6.0 (SP6)

Now on your form, add the new Common Dialog control from the toolbox

this following code to use common dialog :

Private Sub btnBrowse_Click()
    CommonDialog1.Filter = "All files (*.*)|*.*"
    CommonDialog1.DialogTitle = "Select File"
    CommonDialog1.ShowOpen
    
    MsgBox CommonDialog1.FileName
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

as debasisdas said, use common dialog control

First you need to add the component:
* Project > Components
* On the Controls tab, choose Microsoft Common Dialog Control 6.0 (SP6)

Now on your form, add the new Common Dialog control from the toolbox

this following code to use common dialog :

Private Sub btnBrowse_Click()
    CommonDialog1.Filter = "All files (*.*)|*.*"
    CommonDialog1.DialogTitle = "Select File"
    CommonDialog1.ShowOpen
    
    MsgBox CommonDialog1.FileName
End Sub
Sturdy commented: Thank you.. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

If this thread already answered then please mark this thread as solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I am currently using Visual Basic Pro 2010, if someone could assist me on my coursework it will be appreiciated.

Actually if you post in right section (i mean in vb.net section), you will get more advice there..

Jx_Man 987 Nearly a Senior Poster Featured Poster

okay..
post your save code and load code..
i'll fix it with open dialog code.

Jx_Man 987 Nearly a Senior Poster Featured Poster

okay..
post your save code and load code..
i'll fix it with open dialog code.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Dim Myds as New DataSet
Dim Mycmd As New SqlCommand(YourSQLQuery, YourConnection)
Dim Myda As New DataAdapter(Mycmd)
Myda.fill(Myds)
Jx_Man 987 Nearly a Senior Poster Featured Poster

P.manidas : its a great to find the answer..:)
Androidz : I tried the code and i got same errors (i never try the code before). I realized that i could only get last textbox value. When textbox created, its just create one textbox (even you create more than 1 textboxes), so we need to identify all created textboxes. I was try to use typeofcontrol to identify the textboxes and code from P.manidas is complete the answer with Instr function (thanks to P.manidas) :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

add rs.update after each combo box.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi,
Get the path using opendialog control, then save the path to database.
When you want to show it, just load from database and show it using picture box.
Just it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

how far you doing this?

Jx_Man 987 Nearly a Senior Poster Featured Poster

change your field name with another name..
This may happen because login word already taken by the system.

debasisdas commented: agree +9
Jx_Man 987 Nearly a Senior Poster Featured Poster

please say how to make a simple antivirus in vb 6.0 with instruction

how about make your own thread...Don't rise old thread.
actually abu taher was provide some links about how to make antivirus..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

Private Sub cmdSearchauthor_Click()
    Dim strSearchFor, strCriteria As String, foundFlag As Boolean
    'Search for the Author specified by the user
    strSearchFor = UCase(InputBox("Enter the Author to find:"))
    If Len(strSearchFor) > 0 Then
        datBooks.Recordset.MoveFirst
        lstBooks.Clear
            Do While (Not datBooks.Recordset.EOF)
                If UCase(datBooks.Recordset.Fields("Author").Value) = strSearchFor Then
                    lstBooks.AddItem datBooks.Recordset("Title").Value
                    datBooks.Recordset.MoveNext
                Else
                    datBooks.Recordset.MoveNext
                End If
            Loop
            
            If lstBooks.ListCount < 1 Then
                MsgBox "Unable to locate requested Author.", , "Not Found"
                datBooks.Recordset.MoveLast
            End If
        
    Else
        MsgBox "Must enter an Author.", , ""
    End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this following code for author searhing :

Private Sub cmdSearchauthor_Click()
    Dim strSearchFor, strCriteria As String, foundFlag As Boolean
    'Search for the Author specified by the user
    strSearchFor = UCase(InputBox("Enter the Author to find:"))
    If Len(strSearchFor) > 0 Then
        datBooks.Recordset.MoveFirst
        If UCase(datBooks.Recordset.Fields("Author").Value) = strSearchFor Then
            foundFlag = False
            Do While (Not foundFlag) And (Not datBooks.Recordset.EOF)
                If UCase(datBooks.Recordset.Fields("Author").Value) = strSearchFor Then
                    lstBooks.AddItem datBooks.Recordset("Title").Value
                    datBooks.Recordset.MoveNext
                Else
                    datBooks.Recordset.MoveNext
                End If
            Loop
            foundFlag = True
        Else
            If Not foundFlag Then
                MsgBox "Unable to locate requested Author.", , "Not Found"
                datBooks.Recordset.MoveLast 'move so that EOF is no longer true
            End If
        End If
    Else
        MsgBox "Must enter an Author.", , ""
    End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

you can post your project..
i'll try to fix it..

Jx_Man 987 Nearly a Senior Poster Featured Poster

you can post your project..
i'll try to fix it..

Jx_Man 987 Nearly a Senior Poster Featured Poster

ups..i forgot to add condition.
change this part :

rs.Open "SELECT * from Authors where Author = '" & strsearchfor & "'", Conn, adOpenStatic, adLockOptimistic ' Author is your table name
Jx_Man 987 Nearly a Senior Poster Featured Poster

try This..

Private Sub cmdSearchauthor_Click()
Dim strSearchFor As String, foundFlag As Boolean
'Search for the Author specified by the user
strSearchFor = UCase(InputBox("Enter the Author to find:"))
If Len(strSearchFor) > 0 Then
datBooks.Recordset.Open "SELECT * from Authors", Conn, adOpenStatic, adLockOptimistic ' Authors is your table name
datBooks.Recordset.MoveFirst
Do While (Not datBooks.Recordset.EOF)
lstBooks.AddItem datBooks.Recordset!Title
datBooks.Recordset.MoveNext
Loop
If Not foundFlag Then
MsgBox "Unable to locate requested Author.", , "Not Found"
datBooks.Recordset.MoveLast 'move so that EOF is no longer true
End If
Else
MsgBox "Must enter an Author.", , ""
End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

you need to search it..using sql statment.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what you mean exactly..
post more informations..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Actually you can know how much textboxes was made from the start when user input how much he want to create a textboxes
You can use it..
Store it on global variable and use it when you try to get textboxes value.
ex :

Dim ctr as Integer ' put this declaration at top of all codes
' on button create textboxes code event
...
ctr = text1.Text ' user input how many textboxes will made.. if he input 2 then two textboxes will created..from this you can know how much the textboxes .. 
...


' on button load event (button to get textbox value)
for j = 0 to ctr - 1 ' index star from 0 to ctr (user input) ctr is global variable
  a = a + txt(j).Text ' retrieve all textbox value and add it to a
next j

After read second page i found that you have variable to store how much user want to create textboxes. that is m_jobs.
so you can set as global variable and use it when you try to get textbox value.

for j = 0 to m_jobs - 1 ' index star from 0 to m_jobs (user input) 
  a = a + txt(j).Text ' retrieve all textbox value and add it to a
next j

Or you still use ctr as global variable but you still need to assign value from m_jobs

' at created textbox code
ctr = m_jobs

so you …

Jx_Man 987 Nearly a Senior Poster Featured Poster

because you set Flag to True.
After first looping program will check the flag state is true or false, but program get your flag is true then program will stop to read data..
pick your flag out of looping.

Do While (Not foundFlag) And (Not datBooks.Recordset.EOF)
    If UCase(datBooks.Recordset.Fields("Author").Value) = strSearchFor Then
     
      lstBooks.AddItem datBooks.Recordset.Fields("Title").Value

      Else
      datBooks.Recordset.MoveNext
    End If
  Loop
  foundFlag = True
cindy s commented: very helpful person +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Okay..
1. Dont try to get textbox value while it created on the form. (you do this in page 1)
2. separate your textbox created codes with your get value from text box codes.
3. Put this following code on button click event.

for j = 0 to ctr ' index star from 0 to ctr (user input)
  a = a + txt(j).Text ' retrieve all textbox value and add it to a
next j

4. You said that ctr is user input. then how you get ctr value?