Need Help Creating a List
Hello
I am trying to create a member directory one where you click add new member, then input all of their information then click okay and have it appear on a list under the correct collumns and also have it save to an .ini file. I have the new member button all figured out, but i cant seem to make it so the information entered in the new member screen appears on the list.
Can anyone please help me? Or lead me to an example>?
# 2 Re: Need Help Creating a List
Basically what im trying to do is create a system for a game arcade company to use. So far i have sucessfully created lists for reservations and active players using these codes to imput the data into the list:
Public Function AddReservation(t, n, s, p, tb, notes)
Dim i As Integer
With Main.lst
i = .ListItems.Count + 1
tme = FormatDateTime(t, vbLongTime)
.ListItems.Add , , Left$(tme, Len(tme) - 6) & Right$(tme, 3)
.ListItems(i).ListSubItems.Add , , n
.ListItems(i).ListSubItems.Add , , s
.ListItems(i).ListSubItems.Add , , p
.ListItems(i).ListSubItems.Add , , tb
.ListItems(i).ListSubItems.Add , , notes
End With
End Function
and
Public Function LoginPlayer(t, n, num, phn, st, notes)
Dim i As Integer
With Active.lst1
i = .ListItems.Count + 1
tme = FormatDateTime(t, vbLongTime)
.ListItems.Add , , Left$(tme, Len(tme) - 6) & Right$(tme, 3)
.ListItems(i).ListSubItems.Add , , n
.ListItems(i).ListSubItems.Add , , num
.ListItems(i).ListSubItems.Add , , phn
.ListItems(i).ListSubItems.Add , , st
.ListItems(i).ListSubItems.Add , , notes
End With
End Function
I use the tme item to display the time that the person logs in at, but when Im trying to create a member directory im using same function but without the tme, and for some reason it wont display on the list.
Any Ideas?
# 3 Re: Need Help Creating a List
Phil was asking about the control , okey now clearly u use the listview which refer to MSComctl ocx .
your code is working just you need header :
try to use this at the begineng of the programme (form load say) :
With Active.lst1
.View = lvwReport
.ColumnHeaders.Add Text:="Time"
.ColumnHeaders.Add Text:="n"
.ColumnHeaders.Add Text:="num"
.ColumnHeaders.Add Text:="phn"
.ColumnHeaders.Add Text:="st"
.ColumnHeaders.Add Text:="notes"
end with
Amahdy at 2007-11-11 17:25:17 >

# 6 Re: Need Help Creating a List
API:
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
USE:
WritePrivateProfileString(SectionName, KeyField, KeyVal, FilePath)
also try to learn more about :
WritePrivateProfileSection()
WriteProfileString()
WriteProfileSection()
Amahdy at 2007-11-11 17:28:22 >
