I currently use the following VBA code to get the MAX record just after commit:
<BEGIN VBA> Dim strSQLLot As String
Dim strSQLFailure As String
Dim intFailed As Integer
Dim intCounter As Integer
Dim dbConn As ADODB.Connection
Dim recSet As ADODB.Recordset
Dim intNextFailureId As Integer
Dim intArray() As Integer
Dim dbs As DAO.Database
Dim rsSQL As DAO.Recordset
Dim intMaxLotId As Integer
Dim intNewLotID As Integer
'Open the database
Set dbConn = CurrentProject.Connection
'Write the form's data to the SQL table tblInitialData
'determine MAX Lot ID number
intMaxLotId = DLookup("MaxOfTestLotID", "tblMaxLotID")
'Prompt user with MAX Lot ID Number.
MsgBox "Lot number " & intMaxLotId & " has been created.", , "ATE DATABASE"
'open switchboard and close initial form
I previously tried to get a SELECT statement to run but had no luck. I would like to use either SCOPE_IDENTITY() or @@IDENTITY but cannot determine the correct VBA to make that run. Indeed, will it even run in scope based on using the DoCmd.RunCommand acCmdSaveRecord statement instead of an INSERT INTO statement? I have tried DoCmd.OpenQuery, CurrentDb.Execute, and others that apparently do not allow SELECT statements.
Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works
The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…