I'm making a collection DB. I would like to send it out to friends for testing and feedback but would like to give them a limit of 10 records (as a test) instead of the entire DB. How do I go about doing that? Thnx.
I'm making a collection DB. I would like to send it out to friends for testing and feedback but would like to give them a limit of 10 records (as a test) instead of the entire DB. How do I go about doing that? Thnx.
Code it that way and only send out an accde.
Or copy your DB and delete all but 10 records to send out. If you have multiple tables with data then it gets complicated. Or copy DB and delete data and add 10 records.
but can i make it that will only accept 10 records so they can test it? how do I limit the DB?
Do not allow New Record if RecordCount >9
thanks...where do I put that?
Odd; usually the more data you allow, the more likely it is that someone will generate an error during a process, plus it gives a more complete picture of how it's going to look - maybe even perform. Is it likely that any tester would devote the effort to produce hundreds of records when they know it's only for testing and the data is likely to be insignificant beyond that? Seems more trouble than it's worth. You could only limit the records if you performed a count of some sort on the table/query that the form is based on (DCount would suffice if the chosen field cannot be Null) before moving to a new record. One could still add records to a table if they're accessible, and work around the limitation. As a user, I'd also be annoyed if you allowed me to start entering a record and when at the end of the process, disallowed it because of some arbitrary count. Thus this should be done on form load also, and don't allow access to the controls when the limit is reached.
Last edited by Micron; 07-31-2017 at 06:28 PM. Reason: correction & grammar
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Would it not be as simple as instructing to just add about x number of records? Usually, it's harder to get people involved as opposed to getting them to agree to do minimal work.It will probably take you longer to code for this limitation than it will take them to input 10 records because you can't impose a limit via table design AFAIK.
negative...it needs to have a limit on a preview version...then I can release the full one after their input...Would it not be as simple as instructing to just add about x number of records? Usually, it's harder to get people involved as opposed to getting them to agree to do minimal work.It will probably take you longer to code for this limitation than it will take them to input 10 records because you can't impose a limit via table design AFAIK.
Lest I sort of hijacked this with my questions, have you gleaned how to do this from everything else that was posted on it? If not, I'm saying you can't impose it on a table, so you must know the number of records behind the form and determine this at one or more points. From the point of starting a new record, the best is probably in the form BeforeInsert event, which fires as soon as the user types into a control.
You could do this in another event such as a button click, but if form controls are bound to the table and you allow the record creation to start, you will also have to delete it because it has already been created.Code:If DCount("SomeField", "SomeTable")>9 Then msgBox "You have reached the 10 record limit." Cancel = True End If
The field used to count the records cannot allow Nulls, or you will have to find another way, such as getting the .RecordCount of a table def or the form itself, presuming it hasn't been filtered by a query.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Using the code above I devised the correct syntax to get mine to work...thanks.
Private Sub cmdNew_Click()
If DCount("Games", "tblGames") > 14 Then
MsgBox "You have reached the 15 record limit."
Cancel = True
Else
DoCmd.GoToRecord , , acNewRec
End If
End Sub
And this cancels the record creation for sure? I would have thought this way of coding would neither cancel record creation since you're attempting to do so from a click event (which cannot be canceled) plus it looks like the wrong syntax. If it works then it's a surprise to me.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
What about simply setting a validation on the ID field of the table in question? EG Validation Rule: Between 1 and 10
It kind of sounds like your doing this so you can send the DB out to potential customers for evaluation? Like before purchasing?
Good thought, but if it's possible to delete records, this calculated limit would be reached before the record limit.