Hi Tim, done that didn’t work, I will try and explain what I have.
I have a Containercontrol called “Mydrivers” in there I have a save button with the following code on it.
[code] Dim dr as new DatabaseRecord
dim rs as recordset = app.karter.SQLSelect("select * from mydriver where PK = "+ str(mydriverpk))
dr.column(“name”) = trim(txtname.text)
dr.column(“licenseno”) = trim(txtlicenseno.text)
dr.column(“licenseex”) = trim(txtlicenseex.text)
app.karter.commit
msgbox"New Record Added"[/code]
Code has been shortened to save space, this method saves fine to the database.
I also have a Method in the container called UpDateDrivers.
[code] Dim rs as RecordSet = app.karter.SQLSelect(“select * from mydriver Order by name”)
while not rs.eof
txtname.appendtext rs.Field(“name”).stringValue + endofline
popupmenu1.AddRow rs.Field(“name”).StringValue
popupmenu1.RowTag(popupmenu1.ListCount-1) = rs.Field(“PK”).IntegerValue
rs.MoveNext
wend
popupmenu1.ListIndex = 0[/code]
There is also a Method called Save, this updates the record from a “update record button” it is called with the following
save(popupmenu1.RowTag(popupmenu1.ListIndex))
and the code for the save Method is
app.karter.SQLExecute("BEGIN TRANSACTION")
Dim dr as new DatabaseRecord
dim rs as recordset = app.karter.SQLSelect("select * from mydriver where PK = "+ str(mydriverpk))
rs.Edit
rs.field("name").StringValue = trim(txtname.text)
rs.field("licenseno").StringValue = trim(txtlicenseno.text)
rs.field("licenseex").StringValue = trim(txtlicenseex.text)
rs.field("transno").StringValue = trim(txttransno.text)
rs.field("raceno") .StringValue= trim(txtraceno.text)
rs.field("classes").StringValue = trim(txtclasses.text)
rs.field("raceteam").StringValue = trim(txtraceteam.text)
rs.field("sponsors").StringValue = trim(txtsponsors.text)
rs.field("club").StringValue = trim(txtclub.text)
rs.field("clubmemno").StringValue = trim(txtclubmemno.text)
rs.field("clubwebsite").StringValue = trim(txtclubwebsite.text)
rs.field("clubhometrack").StringValue = trim(txtclubhometrack.text)
rs.field("clubemail").StringValue = trim(txtclubemail.text)
rs.field("clubcontact").StringValue = trim(txtclubcontact.text)
rs.field("clubmailing").StringValue = trim(txtclubmailing.text)
rs.field("comments").StringValue = trim(txtcomments.text)
rs.update
app.karter.commit
msgbox"Record has been Updated"
All the code I have works fine in the older version of the program, I am now trying to update the code using containercontrols and a main window with a tab panel, as it was previously all done with seperate windows.
I dropped the Containercontrol on the tab pannel and it is called Mydrivers1
When I add MyDrivers1.UpDateDrivers to the bottom of
Dim dr as new DatabaseRecord
dim rs as recordset = app.karter.SQLSelect("select * from mydriver where PK = "+ str(mydriverpk))
dr.column("name") = trim(txtname.text)
dr.column("licenseno") = trim(txtlicenseno.text)
dr.column("licenseex") = trim(txtlicenseex.text)
dr.column("transno") = trim(txttransno.text)
app.karter.commit
msgbox"New Record Added"
I get the Error
This item does not exist
Mydrivers.Updatedrivers ----The Error is on MyDrivers
Hope this makes sense, thanks