|
-
Mar 11th, 2004, 01:29 PM
#1
Thread Starter
Fanatic Member
database problems
i have a database linked up to a form. It is to add to the database. I only want a limit of 20 records in the database. If after that 20 records then the database should go back to the first record. At the momment the database goes to record 21 i want it to go back to the first record.
My code is as follows,:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
If objupdate.update_staff_details.Count = 20 Then
btnAdd.Visible = False
MsgBox("Warning, Exceeded User Limits, Max 20", MsgBoxStyle.OKOnly)
Me.BindingContext(objupdate, "update staff details").Position = 0
End If
Try
'Clear out the current edits
Me.BindingContext(objupdate, "update staff details").EndCurrentEdit()
Me.BindingContext(objupdate, "update staff details").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
Me.objupdate_PositionChanged()
End sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|