Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code that adds a record to an Access database:
Sub ADOFromExcelToAccess() Dim cn As ADODB.Connection, rs As ADODB.Recordset Set cn = New ADODB.Connection cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _ "Data Source=S:\MalLab\MAL_DB.mdb;" Set rs = New ADODB.Recordset rs.Open "CurrentPMT", cn, adOpenKeyset, adLockOptimistic, adCmdTable With rs .AddNew .Fields("CurrentPMTScore") = Sheet1.Range("F1").Value .Update End With rs.Close Set rs = Nothing cn.Close Set cn = Nothing End Sub Can someone tell me how to overwrite the existing record instead of adding a new one. Thanks in advance, MikeS |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open new record with selected fields from previous record | Excel Discussion (Misc queries) | |||
Prevent PivotTable Overwrite Warning and Disallow Overwrite | Excel Programming | |||
Record macro doesn't record shape properties | Excel Programming | |||
Record Macro - Record custom user actions | Excel Programming | |||
Need help autopopulating next new record with previous record data | Excel Programming |