Hi,
I have a textbox connected to a database in SQL Server 2014 using the following code:
If the user changes the text in TxtCustomer and then the user presses a command button which runs a CurJobRecord.update command, the value in the database is updated fine. However when the value in TxtCustomer is updated from code and the recordset is updated from code, the value fails to update in the database.Code:Set frmMain.TxtCustomer.DataSource = CurJobRecord frmMain.TxtCustomer.DataField = "Customer"
This is the code which originally opens the CurJobRecord RecordsetCode:TxtCustomer.Text = "Test" CurJobRecord.Update
If anybody has any solutions as to why this is happening it would be appreciated.Code:Set TempRS = New ADODB.Recordset TempRS.Open SQL, ConJobData, adOpenDynamic, adLockOptimistic If TempRS.EOF = False Then If CurJobRecord.State = adStateOpen Then CurJobRecord.Update CurJobRecord.Close End If Set CurJobRecord = TempRS
Thanks for your time,
Hustey




Reply With Quote
