When 2 persons use the same form, the second can't confirm his operation
Here is the code :
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim StrSql As String
Set cn = CurrentProject.Connection
cn.BeginTrans
StrSql = "Select * FROM QryEtik WHERE etservice =" & Chr(34) & [Forms]![frminventaire]![inservice] & Chr(34) & " and etnum =" & [Forms]![frminventaire]![inetik]
rst.Open StrSql, cn, adOpenKeyset, adLockOptimistic
If rst.RecordCount = 0 Then
MsgBox "Le N° d'étiquette n'est pas attribué à la zone mentionnée"
Me.Undo
DoCmd.GoToControl "inetik"
Exit Sub
End If
Thanks for your help
Francky
Here is the code :
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim StrSql As String
Set cn = CurrentProject.Connection
cn.BeginTrans
StrSql = "Select * FROM QryEtik WHERE etservice =" & Chr(34) & [Forms]![frminventaire]![inservice] & Chr(34) & " and etnum =" & [Forms]![frminventaire]![inetik]
rst.Open StrSql, cn, adOpenKeyset, adLockOptimistic
If rst.RecordCount = 0 Then
MsgBox "Le N° d'étiquette n'est pas attribué à la zone mentionnée"
Me.Undo
DoCmd.GoToControl "inetik"
Exit Sub
End If
Thanks for your help
Francky