1
我有一個用於生成隨機數的vba。這個數字是在打開表單後生成的,這很好,但是它也需要在創建新記錄後生成一個代碼,這個怎麼做?插入新記錄後訪問vba執行
Private Sub Form_Open(Cancel As Integer)
Dim strPin As String
Dim i As Integer
strPin = "JobNr: "
'Set seed
Call Randomize
For i = 1 To 5
strPin = strPin & Int(10 * Rnd)
Next
Me.random_nr = strPin
End Sub