UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Module Help    
 
   
BeitersITAdmin
post Apr 17 2012, 02:21 PM
Post #1

New Member
Posts: 3



Fairly new to doing any Modules. I have a small database set up to handle daily scheduling for a delivery company. We are now expanding to numerous areas and need to change my code and am getting lost. Currently I have the following code on my entry form to limit the number of daily deliveries;

If DCount("*", "M_tbl_Schedule") >= 10 Then
MsgBox "Maximum number of records allowed has been reached", vbOKOnly + vbExclamation, "Day Full"
'code to stop entry of new records

What i am looking to do now is have this check two(2) Criteria 1) date, and 2) Delivery area. and set a maximum number per Date, and per delivery area. My Tables are listed below;


Table 1

M_D_Schedule

ID PK
Delivery_Area FK
Full_Name
Address
Town
State
Zip
Phone
Invoice
Items
Notes
Date Scheduled


Not Sure if this table is really necessary

Table 2
M_D_AREA
ID PK
Area

Can any give me some guidance or point me to where i can read up on this??

Thanks in advance for any assistance,

Dave


Go to the top of the page
 
+
ScottGem
post Apr 17 2012, 03:53 PM
Post #2

UtterAccess VIP / UA Clown
Posts: 25,091
From: LI, NY



I would create a table of the max per delivery area, then look that up.

I'm not sure what the date would be are we talking day of week> day of month or just an arbitrary number you set for each date.

But using a table allows you to adjust the max as needed.
Go to the top of the page
 
+
gemmathehusky
post Apr 18 2012, 02:22 AM
Post #3

UtterAccess VIP
Posts: 1,914
From: UK



out of interest, why would there be an absolute maximium. surely sometimes a delivery run COULD do more than 10 drops.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 04:50 AM