Hi,

I have a textbox connected to a database in SQL Server 2014 using the following code:
Code:
Set frmMain.TxtCustomer.DataSource = CurJobRecord
frmMain.TxtCustomer.DataField = "Customer"
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:
TxtCustomer.Text = "Test"
CurJobRecord.Update
This is the code which originally opens the CurJobRecord Recordset
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
If anybody has any solutions as to why this is happening it would be appreciated.

Thanks for your time,

Hustey