I have a form that needs to enter some data into a form. I can not do this by bounding the the textbox to the table, therefore i am having to use ORs. I am using the following code in VBA but is not working:
'Save Payment Type
Dim oRS As New ADODB.Recordset
oRS.Open "SELECT PaymentType FROM tblTransMain;", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
oRS.AddNew
oRS!DetailLink = txtIDRef
oRS!PaymentType = TEST
oRS.Update
oRS.Close
Set oRS = Nothing
What i want the above todo is Select the field PaymentType from tblTrainsMain Where IDRef = txtIDRef. It will then place TEST in that field only.
At the moment the above creats a new record, which i do not want it todo.
Thanks,
D
'Save Payment Type
Dim oRS As New ADODB.Recordset
oRS.Open "SELECT PaymentType FROM tblTransMain;", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
oRS.AddNew
oRS!DetailLink = txtIDRef
oRS!PaymentType = TEST
oRS.Update
oRS.Close
Set oRS = Nothing
What i want the above todo is Select the field PaymentType from tblTrainsMain Where IDRef = txtIDRef. It will then place TEST in that field only.
At the moment the above creats a new record, which i do not want it todo.
Thanks,
D