Can anyone tell me what I am doing wrong? I have linked a table from an ODBC database to my Access database. I want to assign a value from a field in the first record of the table to a variable using a module. When I run the code it returns the message "Record is deleted." Here's the code that I'm using. Is is correct? It works for tables linked from another access database.
======================================
Dim cnt As Integer
Dim dbs as Database
Dim rstInvoiceNo As Recordset
Set dbs = CurrentDb
Set rstInvoiceNo = dbs.OpenRecordset("AR0_Parameters"
rstInvoiceNo.MoveFirst
cnt = rstInvoiceNo.Fields("NextAutomaticInvoiceNumber"
======================================
The table AR0_Parameters is linked to my access database from an ODBC compatible database.
======================================
Dim cnt As Integer
Dim dbs as Database
Dim rstInvoiceNo As Recordset
Set dbs = CurrentDb
Set rstInvoiceNo = dbs.OpenRecordset("AR0_Parameters"
rstInvoiceNo.MoveFirst
cnt = rstInvoiceNo.Fields("NextAutomaticInvoiceNumber"
======================================
The table AR0_Parameters is linked to my access database from an ODBC compatible database.