If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Limit the size of an Access Table
I want to create a table that will accept only a limited number of records -
say 10 records. I want the user to be able delete or add records but I don't want the total number of records to exceed 10. How do I do this? |
#2
|
|||
|
|||
Limit the size of an Access Table
Assuming that your interface means users can only add new records via a
form, use the BeforeInsert event procedure to test if there are already 10 in the table. This kind of thing: Private Sub Form_BeforeUpdate(Cancel As Integer) If DCount("*", "Table1") = 10 Then Cancel = true MsgBox "no more!" End If End Sub -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "ROC" wrote in message news I want to create a table that will accept only a limited number of records - say 10 records. I want the user to be able delete or add records but I don't want the total number of records to exceed 10. How do I do this? |
Thread Tools | |
Display Modes | |
|
|