G
Guest
How can I add a autonunmber from table1 into table 2, however there is
already data contianed in Table 2 (which was copied over from Table 3) in
other columns and I need the autonumber to be entered next to the data.
The following code I have tried but one add's a new row and the other edits
the existing autonumber in the table which is not what I want.
Dim rs As DAO.Recordset
Dim kc As DAO.Recordset
Dim kct As DAO.Recordset
Dim ba As Long
Set rs = CurrentDb.OpenRecordset("Table1")
Set kc = CurrentDb.OpenRecordset("Table2")
Set kct = CurrentDb.OpenRecordset("Table3")
ba = rs!BANo 'This is where I have stored the autonumber created when table
1 is updated from the main form.
If kct!Order <> "" Then
kc.Edit or kc.AddNew
kc!BANo = ba
kc.Update
End If
Thanks
already data contianed in Table 2 (which was copied over from Table 3) in
other columns and I need the autonumber to be entered next to the data.
The following code I have tried but one add's a new row and the other edits
the existing autonumber in the table which is not what I want.
Dim rs As DAO.Recordset
Dim kc As DAO.Recordset
Dim kct As DAO.Recordset
Dim ba As Long
Set rs = CurrentDb.OpenRecordset("Table1")
Set kc = CurrentDb.OpenRecordset("Table2")
Set kct = CurrentDb.OpenRecordset("Table3")
ba = rs!BANo 'This is where I have stored the autonumber created when table
1 is updated from the main form.
If kct!Order <> "" Then
kc.Edit or kc.AddNew
kc!BANo = ba
kc.Update
End If
Thanks