Jx_Man 987 Nearly a Senior Poster Featured Poster

How far you doing this? post your code, so we can help you :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Visit this site. You can learn much about vb.net there. Also there are good Tutorial about database project.

Jx_Man 987 Nearly a Senior Poster Featured Poster

guys i solved problem to add new datareport.
so thx for help.

Nice work.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Dim i As Integer
If ListView1.SelectedItems.Count = 0 Then Exit Sub 
i = Val(ListView1.SelectedIndices.Item(0).ToString)
MsgBox(ListView1.Items(i).SubItems(1).Text)
End Sub

You also can use this line of code to get selected index :

i = Val(ListView1.SelectedItems(0).Index)
'and this
i = ListView1.SelectedIndices(0)
dnk commented: Your helping make this thread solved after 2 years :D +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Good. I Really appreciate when you make some effort.
You made mistake when put "next i". You just need to update the recordset.
You don't have to update data field of datareport. When you assign DataReport source with Recordset it will accommodate all data of listview on recordset.
So, it should be like this :

Dim RsTest As Recordset
Dim i As Integer
Set RsTest = New ADODB.Recordset
 
With RsTest.Fields
.Append "Field1", adDouble
.Append "Field2", adBSTR
.Append "Field3", adInteger
End With
 
RsTest.Open

For i = 1 To MyList.ListItems.Count
    With rsTest
        .AddNew
        .Fields("Field1") = MyList.ListItems(i).Text
        .Fields("Field2") = MyList.ListItems(i).SubItems(1)
        .Fields("Field3") = MyList.ListItems(i).SubItems(2)
        .Update
    End With
Next i ' Put here

Set DataReport1.DataSource = RsTest
With DataReport1.Sections("Section1")
.Controls("Text1").DataField = "Field1"
.Controls("Text2").DataField = "Field2"
.Controls("Text3").DataField = "Field3"
End With

DataReport1.Refresh
DataReport1.Show 1
Jx_Man 987 Nearly a Senior Poster Featured Poster

please dont mind ..I am in trouble . i am new in this field please dont pay tension on my minute questions.
I read it buti think there is rsTest which related to database. Can u sent me total Button code. Which transfer data of List view to Data report?

yes i read this code.you are right. there is no database involved.Please send me example where can i put data on datareport from ListView.

If you already read it then Make some effort.
I was give you a sample code now your turn to modified it as you needed.
Use looping to get data from listview and update recordset for each row.
Recordset will receive all data from listview.
Set datareport source to recordset then show it to data report.
Just it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

But i dont want to use any database.

Did u read this code correctly?
This code didn't use any database.
Are you trying this code?

My problem is to transfer data of Listview and textboxs (list on any form of VB6 Application ) directly to Database.

I already give you this sample code, now your turn to modified it with listview items data.

Please help me as soon as possible.

Do not expect this. You not pay me to get this code.

november_pooh commented: He the lazy one..don't get mad for him. +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

See If This Helps :

An example of writing a file:
Dim sFileText as String
Dim iFileNo as Integer
iFileNo = FreeFile
'open the file for writing
Open "D:\Test.txt" For Output As #iFileNo
'please note, if this file already exists it will be overwritten!

'write some example text to the file
Print #iFileNo, "first line of text"
Print #iFileNo, " second line of text"
Print #iFileNo, "" 'blank line
Print #iFileNo, "some more text!"

'close the file (if you dont do this, you wont be able to open it again!)
Close #iFileNo
Sturdy commented: Really a Vig Help +1
Estella commented: Nice :D +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

Create a procedure to select data from table and display it to flexgrid.
Then call this procedure after adding data or any at event that you want.

Jx_Man 987 Nearly a Senior Poster Featured Poster

is this code running well? i mean, this code can display data to combo box?

Combo1.AddItem !Office_Code '& vbTab & !Office_Title

You use vbtab to separate data. is that working?
I think VbTab not working to separate it.
You can use space or commas (or other sign) .

Combo1.AddItem !Office_Code & " " & !Office_Title ' Separate With Space
Combo1.AddItem !Office_Code & "," & !Office_Title ' Separate With Commas

How to display the field in text box using combo box. When the user click the combo box, two fields will be displayed, the first field will be displayed in 1st text box1 and 2nd field in text box2.

Okay, you can display it on combobox click event. Use split to separate data in combo box with delimiter is space or commas (or other sign that you used to separated in combo box).

Private Sub Combo1_Click()
    Dim temp As Variant
    temp = Split(Combo1.Text, " ") ' Split it with space delimeter, store it as array in temp.
    ' Accessing separated data on temp variable
    Text1.Text = temp(0) 
    Text2.Text = temp(1)
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Please i need your help in writing pseudocodes on the who wants to be a millionaire game.

You First. show your effort.

Jx_Man 987 Nearly a Senior Poster Featured Poster

See this thread

Jx_Man 987 Nearly a Senior Poster Featured Poster

Are you have tried to set from textbox properties? On MaxLength.

Jx_Man 987 Nearly a Senior Poster Featured Poster

This an example :
Modified as u needed.

Set rsTest = New ADODB.Recordset

With rsTest.Fields
.Append "Field1", adBSTR
.Append "Field2", adBSTR
.Append "Field3", adBSTR
End With

rsTest.Open

With rsTest
.AddNew
.Fields("Field1") = "Test1"
.Fields("Field2") = "Test2"
.Fields("Field3") = "Test3"
.Update
End With
Set DataReport1.DataSource = rsTest
With DataReport1.Sections("Section1")
.Controls("Text1").DataField = "Field1"
.Controls("Text2").DataField = "Field2"
.Controls("Text3").DataField = "Field3"
End With
DataReport1.Refresh
DataReport1.Show 1
End Sub
dnk commented: Great Code +2
ITKnight commented: I even never think about this way..it's awesome dude. +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Or you can set it with code at form load:

TextBox1.MaxLength = 3
Jx_Man 987 Nearly a Senior Poster Featured Poster
if (count<max) and (br.checked=true or am.checked=true) then
'code
end if

Yes, you can do this.

ninjatalon commented: thanks +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Function HasConnectivity() As Boolean
    Dim hostInfo As System.Net.IPHostEntry
    Try 'to look for the logon server
        Dim sServer As String = Environment.GetEnvironmentVariable("logonserver")
        hostInfo = System.Net.Dns.GetHostByName(sServer.Remove(0, 2))
        Return True
    Catch 'theres no network connection
        Return False
    End Try
End Function

For Checking :

If HasConnectivity() = True Then
   ' Your Ping Code
Else
   MsgBox("not connected")
End If
Jx_Man 987 Nearly a Senior Poster Featured Poster

use "<=" operator in your select statement.

Jx_Man 987 Nearly a Senior Poster Featured Poster

1. Go to Project->Project Properties, In General Tab make sure that your Project Type is Standard Exe. You can also change the Application Title, Icon, Version and Version Information in Make Tab.
2. If you sure to build it then go to File->Make Project.Exe, Save Dialog will appear to save your Exe File, default path is your project path.
3. Check after save the exe file. it already to run. Just it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Did you visit the site?
There are code for printing and sample code too.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Check your Timer Enable Properties.
Make sure that is set to True, also check for Timer Interval is not 0.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Ex: if I enter the core in 4, then the program will show the game with 4 core and below.

Use Search Statement. Find for game with 4 core.

Jx_Man 987 Nearly a Senior Poster Featured Poster
dnk commented: Surely great site finding.. +2
Naruse commented: Good reference +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome.
Happy Coding

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :
Text1 is filled by any text or words
Text2 is filled by char to find.

Private Sub Command1_Click()
    Dim CharCount, i As Integer
    CharCount = 0
    For i = 0 To Len(Text1.Text)
        Text1.SetFocus
        Text1.SelStart = i
        Text1.SelLength = 1
        If Text1.SelText = Text2.Text Then 
            CharCount = CharCount + 1 sesuai
        End If
    Next
    MsgBox "You have " & CharCount & " Character " & Text2.Text
End Sub
dnk commented: Good job +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

FileOpen is not available in vb6 but in vb.net
I will ask moderator to move this thread to vb.net section.
You will get more answer there from many gurus.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Change with this :

My.Computer.Audio.Play(Application.StartupPath & "\beep-2.wav")
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :

Application.StartupPath
Jx_Man 987 Nearly a Senior Poster Featured Poster

This part code :

If displayText.Text > TextBox2.Text Then ' Line 8
     amount = displayText.Text - TextBox2.Text ' Line 9

Your textbox2 value is String. you cannot subtract or compare it with a double value.
You need to convert it to double.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Use Left() function.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Or you can use Left() function to get it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :
Assuming that the ListView already have a header, so index i start from 1.
If you don't have header then index start from 0.

Private Sub Command1_Click()
Dim temp As Integer
temp = 0
For i = 1 To ListView1.ListItems.Count
    'temp = temp + Val(ListView1.ListItems.Item(i).Text) ' First Column
    temp = temp + Val(ListView1.ListItems(i).SubItems(1)) ' Second Column 
    'temp = temp + Val(ListView1.ListItems(i).SubItems(2)) ' Third Column
Next i
MsgBox temp
End Sub
Jade_me commented: Thank You for always helping..i hope you can help me on another thread.. :D +2
november_pooh commented: Great help :) +3
Vega_Knight commented: Very helping person +2
Sawamura commented: Good. +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

Please make new thread for different question.
It will help another members if they have same problem like you.
Also other members can help to answer you question if you have specific thread.
If this thread already done than please mark as solved.

Thank you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

so what the result of your codes above?
any errors?
in which sub item of listview that you want to sum the items?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Okay.
And if this thread already done then please mark it as solved.
Thank you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

What is the best thing to do if i have millions of data.please help me sir

Don't display the entire data but display it separately.
You can use navigate button..
I recommended you to make a new spesific thread to asking about displaying a millions data. There are many members will give a good answer.

Jx_Man 987 Nearly a Senior Poster Featured Poster

can i still get the number of selected row without clicking that button?

So in any event you want to put it?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Show your effort.

Jx_Man 987 Nearly a Senior Poster Featured Poster

My question is that, is this code safe for millions of data and then loading it in my listview.

I think the code is safe.
But it consume many times to load a millions data.
I think its not good to displaying all entire data in one time.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Change combo box Event from Combo1_Change() to Combo1_Click() :

Private Sub Combo1_Click()
Select Case Me.Combo1
    Case "bob"
        Me.Combo2.Enabled = True
    Case "carol"
        Me.Combo2.Enabled = True
    Case "jeff"
        Me.Combo2.Enabled = False
    Case "freeda"
        Me.Combo2.Enabled = False
    Case Else ' this for case else
        Me.Combo2.Enabled = False
End Select
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

use Split function to separate it by ":" then add the result.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Its working to me..I run your codes and i got string with commas inside.

Jx_Man 987 Nearly a Senior Poster Featured Poster

its working if im not using "datagrid marquee style= highlight rows".. but i really nid to highlight all the column in a row when someone click on it. should i just use for loop to get the number of rows highlighted? or you have a better idea for this?

It's still works to me.
I already set marquestyle = dbghighlightrow and i still can use DataGrid1.SelBookmarks.Count to get number of selected rows.

Jx_Man 987 Nearly a Senior Poster Featured Poster

If you want to know how many rows are selected then DataGrid1.SelBookmarks.Count works great to me.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Just give feedback if you have a problem

Jx_Man 987 Nearly a Senior Poster Featured Poster

Change this line (at line # 8):

t = Mid(msg, i, Len(msg))

With this :

t = Mid(msg, i, Len(msg)) + Left(msg, i)

Hope it helps :)

dnk commented: Really helpfull person. +2
Neji commented: Good eyes for this.. +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

i already make it scrolling

Post the code..how far you doing this.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You mean system directory?

See if this helps :

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
    Dim sSave As String, Ret As Long
    sSave = Space(255)
    Ret = GetSystemDirectory(sSave, 255)
    sSave = Left$(sSave, Ret)
    MsgBox "Windows System directory: " + sSave
End Sub
Vega_Knight commented: Perfect +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

ok the problem is finally solved,
thanks for every one cheered me up.
i only had a small problem in the criteria seection but it is solved now.
thanks alot

It's great to know you already solved it.
But would you like to share with us how you solved it?
So when another user search a same thread like yours they will get the answer too..

Thank you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

data type mismatch in criteria expression,, this is the error.
i tried many times yesterday, if any one please can help me here..
thanks in advance..

Are you copied all the code without change it? i was wrong in type table name "tblEmployees", it must be "SYS_USER". Sorry, my bad.
So, it should like this follwoing line:

If Me.PASSWORD.Value = DLookup("password", "SYS_USER", "[username]=" & Me.Combo0.Value) Then