I'm wondering how I could get the most recently generated autonumber value from a table in another db. Currently I am doing this:
Do Until rsA.EOF
'Inserts new row here (works)
Set rs = New ADODB.Recordset
rs.Open "SELECT @@Identity" (Connection info)
SQLcmd = "UPDATE tbl SET col = " & rs("SELECT @@Identity").Value & "
(WHERE statement);"
DoCmd.RunSQL SQLcmd
rsA.MoveNext
Loop
But its giving col a value of 0 instead of the newly generated autonumber. Any idea why? Or another way to do this?