Received my msgbox “The record was successfully inserted” but looked and it wasn’t there what did I do wrong?
Please help.
[code]Dim dbFile As FolderItem
dbFile = GetFolderItem(“C:\Users\Richard\Desktop\elite fitness\elite fitness\ew Folder\training folder\ew Folder\clientinfo.sqlite”)
If dbFile <> Nil Then
Dim db As New RealSQLDatabase
db.DatabaseFile = dbFile
Dim r as New DatabaseRecord
if db.connect()then
r = new databaserecord
if lastname.text <> "" then
if firstname.text <> "" then
if startingdate.text <> "" then
if trainer.text <> "" then
r.column("name1") = lastname.text
r.column("name2") = firstname.text
r.column("age1")= age1.text
r.column("address1") = address1.text
r.column("phone1") = phone1.text
r.column("weight")= weightb.text
r.column("Date2") = startingdate.text
r.column("neck") = neckb.text
r.column("forearm") = forearmb.text
r.column("arm") = armb.text
r.column("chest")= chestb.text
r.column("waist")= waistb.text
r.column("hips")= hipsb.text
r.column("abdomen")=abdomenb.text
r.column("thigh")=thighb.text
r.column("calf")=calfb.text
r.column("abdomenskin")=abdomenskinb.text
r.column("chestskin")=chestskinb.text
r.column("thighskin")=thighskinb.text
r.column("bicepskin")=bicepskinb.text
r.column("subrilliamskin")=subrilliamskinb.text
r.column("subscapulaskin")=subscapulaskinb.text
r.column("tricepskin")=tricepskinb.text
r.column("skinfoldsum")=skinfoldsumb.text
r.column("bodyfat")=bodyfatb.text
r.column("fatmass")=fatmassb.text
r.column("leanmass")=leanmassb.text
r.column("Trainer")=Trainer.text
r.column("city")=city.text
r.column("state")=state.text
if radiobutton1.value then
r.column("male") = "true"
else
r.column("female") = "true"
end if
if radiobutton3.value then
r.column("site3") ="true"
elseif radiobutton4.value then
r.column("site4") = "true"
else
r.column("site5") = "true"
end if
db.insertrecord ("clientstats", r)
if db.error then
msgbox db.errormessage
else
msgbox "The record was successfully inserted."
end
else
msgBox "database not written to"
end if
else
msgBox "Please enter Trainer and Press Save Again"
end if
else
msgBox " Please Enter Date and Press Save Again"
end if
else
msgBox " Please Enter First Name and Press Save Again"
end if
else
msgBox " Please Enter Last Name and Press Save Again"
end if
end if[/code]
Edit (paul): Added code tag to make the code readable.