Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
Ciao Cinzia, grazie mille per i tuoi preziosi consigli
ho risolto con questo evento su click che posto al fine possa essere utile a qualcun altro:
Private Sub Comando13_Click()
Dim retValue As Integer
Dim strTtl As String
strTtl = "CHIUSURA REGISTRO GIORNALIERO"
' gli spazi tra le parole della seguente Msgbox sono stati fatti con codice ashi "alt+032" necessario per formattare bene la MSGBOX.
strMsg = " ATTENZIONE, QUESTA E' UN OPERAZIONE IRREVERSIBILE, " & vbCrLf & vbCrLf & " STAI PER CHIUDERE I REGISTRI CONTABILI" & vbCrLf & vbCrLf & "ASSEGNANDO DEFINITAVAMENTE IL NUMERO DI OPERAZIONE . " & vbCrLf & vbCrLf & " SEI CERTO/A DI VOLER PROCEDERE?"
retValue = MsgBox(strMsg, vbCritical + vbYesNo, strTtl)
Select Case retValue
Case vbYes
Dim ss As DAO.Recordset
Set ss = CurrentDb.OpenRecordset("select * FROM Tabella1 where IsNull(Nr)")
DoCmd.GoToRecord , , acFirst
Do Until ss.EOF
ss.Edit
ss!Nr = Format(Nz(Mid(DMax("[Nr]", "[tabella1]", "[Nr] like '????/" & Format(Date, "yyyy") & "'"), 1, 4), 0) + 1, "0000") & "/" & Format(Date, "yyyy")
ss.Update
ss.MoveNext
Loop
Me.Requery
ss.Close
Set ss = Nothing
MsgBox "Registrazione Effettuata correttamente..", , "Autenticazione Registri"
Cancel = True
Case vbNo
End Select
End Sub