Duane-
That's what I want! Thanks a lot.
Best Regards,
Kevin
发自我的小米手机
在 "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2017年3月6日 15:38写道:
Kevin,
I would not hard-code 22 into your code. I would store it in tblTourGroup which I assume has one record per tour. Then in the following code, pull the maximum size from the table and use it to limit the additions.
Private Sub Form_Current()
Dim intMaxRecords As Integer
intMaxRecords = 10
Me.AllowAdditions = Me.RecordsetClone.RecordCount < intMaxRecords
End Sub
Duane Hookom
Switzerland
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of qingqinga qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, March 6, 2017 1:07 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How to limit the records in form?Duane-
Here's the contact:
tblTour Group
TourGroupID
TourGroup…
tblGrouoMember
GrouoMemberID
TourGroupID
GroupMemberName
…
For example, the maximum group size is 22 group members. That's the maximum seats in a tour couch.
So the tour operator has to watch out not to register more than 22.
Please help. Thanks.
Best Regards,
Kevin
发自我的小米手机在 "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2017年3月6日 14:31写道:
Kevin,Please provide some context to your question. Can we assume you are storing the maximum number of records in a related table?
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of qingqinga qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, March 6, 2017 6:45:22 AM
To: ms_access_professionals
Subject: [MS_AccessPros] How to limit the records in form?
Dear All-
How to limit the number of records in forms? For example, when the record reaches 5, then the form will not be allowed to add new records? Thanks in advance.
Best Regards,
Kevin
__._,_.___
Posted by: qingqinga <qingqinga@yahoo.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar