Insert multi records from form button

xaysana

Registered User.
Local time
Today, 10:37
Joined
Aug 31, 2006
Messages
94
Hi,

Is it possible to insert many id number by one click on form button?
The id number shouldn't be duplicated.
eg.

SA0001
.....
.....
.....
SA0100

Thank you
 
You could use the Dmax()+1 to increment your ID and use While/Wend statement to loop[ through your procedure a set number of times.

The attached sample should help you with the Dmax() function.

Wowwwww, this is very useful. thank you so much that.
But i also have another small problem with the following code of mine:

Private Sub Form_Current()

Me.txtStartno.SetFocus

If Me.cbLotno = 0 Or IsNull(Me.cbLotno) Then

Me.cbproducer.Locked = True
Me.cbproducer.Enabled = False
Else
Me.cbproducer.Locked = False
Me.cbproducer.Enabled = True
End If

End Sub

The problem is that when cbLotno = null is correct but when
cbLotno = value (number) a cbproducer is still locked and disabled till i switch to design view and switch back to form view then a cbproducer becomes functional.
Do you have idea about this please?
Cheers,
 
To check what value cbLotno is holding when the code rune insert the following line prior to the logical If test;
Code:
MsgBox "cbLotno currently holds " & [URL="http://www.techonthenet.com/access/functions/advanced/nz.php"]Nz[/URL](cbLotno, "Null")
 

Users who are viewing this thread

Back
Top Bottom