Im trying now to have it after I’ve created a new customer to the database it displays the info in my listbox but now i need it when i click on a customer in the listbox that it autofills in the data from the database to TextFields. Not sure what I’m going to need to do to accomplish this. Can someone point me in the right direction with an example or a link?
Store the rowid from the database in the RowTag of the listbox.
Now, when you change the row, read the RowTag and load the Database entry with this rowid into the textfields.
Dim sql As string
Dim rs as recordset
sql = "Select * from myTable where id = " + myListBox.cell(myListBox.listindex, column) // Column = position of your Primary key
rs = App.myDb.SqlSelect( sql )
If rs <> nil and rs.recordcount > 0 then
txtfield1.text = rs.field("myField").StringValue.DefineEncoding(Encodings.UTF8) // ...or other encoding...
.
.
.
end if
Put then into listbox.change event handler...
[quote=167200:@Adelar Duarte]@Travis McBride , try something like that…
[code]
Dim sql As string
Dim rs as recordset
sql = "Select * from myTable where id = " + myListBox.cell(myListBox.listindex, column) // Column = position of your Primary key
rs = App.myDb.SqlSelect( sql )
If rs <> nil and rs.recordcount > 0 then
txtfield1.text = rs.field(“myField”).StringValue.DefineEncoding(Encodings.UTF8) // …or other encoding…
.
.
.
end if
Put then into listbox.change event handler…
[/code][/quote]
Thank you all so much for that. i was having a brain fart yesterday at work but today I understand exactly what i need to do !!