Hi
I need to read the latest value of invoiceid from a table, into an integer called A1.
Table INVOICE:
invoiceid AS integer
invoicename AS string
I stored a query for the search. I can read/modify the query with this code:
Dim db As dao.Database
Dim qdef As dao.QueryDef
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT invoiceid from invoice;"
Set qdef = db.QueryDefs("search_latest_invoiceid")
qdef.sql = strSQL
qdef.Close
Set qdef = Nothing
Set db = Nothing
DoCmd.OpenQuery "search_latest_invoiceid", acViewNormal
This query returns all invoiceid values.
How can i read the latest invoiceid into an integer called A1 ?
I need to read the latest value of invoiceid from a table, into an integer called A1.
Table INVOICE:
invoiceid AS integer
invoicename AS string
I stored a query for the search. I can read/modify the query with this code:
Dim db As dao.Database
Dim qdef As dao.QueryDef
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT invoiceid from invoice;"
Set qdef = db.QueryDefs("search_latest_invoiceid")
qdef.sql = strSQL
qdef.Close
Set qdef = Nothing
Set db = Nothing
DoCmd.OpenQuery "search_latest_invoiceid", acViewNormal
This query returns all invoiceid values.
How can i read the latest invoiceid into an integer called A1 ?