Results 1 to 8 of 8
  1. #1
    francogaspari is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    14

    SubForm OrderDetails Limitation

    Hi Dear All.
    how can i make a limit to my OrderDetails Subform , to generate just only two order details in each order?
    example:



    Mr. Bla bla Bla

    OrderDetails Subform:

    - Milk - qty 9 - Price: 12$
    -Chocolat - qty 10 - Price: 10$

    and stop here.... i don't want to have the ability to asking for more .

    Thanks.

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    You could use this code to limit the record count to 2 records. Use the Before Insert Event.
    If Form.RecordsetClone.RecordCount > 2 Then
    Cancel = True
    End If
    HTH

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    That seems a strange and restrictive request (business rule). If a Customer makes an Order and that Order includes 5 distinct items, then why would you restrict an Order to only 2 Items? If this is academic then fine, but in the real world such a constraint could/would cost you some business (in my view).

    See free data model here for ideas.
    Good luck with your project.

  4. #4
    francogaspari is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    14
    thank you Burrina, i will try it now
    and
    Orange in the program i am making , in each order i make , i just sell TWO products only not more, but maybe can be ONE but sure not THREE for zat.
    Last edited by June7; 07-14-2014 at 04:53 PM.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    And you never plan to add another product or two to your products list- ever?
    Ok as I said strange and restrictive, but in your case it seems appropriate.

    Good luck.

  6. #6
    francogaspari is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    14
    Dear Mr. Orange
    i sell Insurance Car Policies, in each "order" i make, there is one client , and just two policies not more. One for Motor Damage and Another One for Motor Bodily Injury and in some cases client ask for just the first one

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Perfect for your current business. I was just thinking that it would be restrictive if you decided to sell Life Insurance or Boat Insurance etc.

  8. #8
    francogaspari is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    May 2014
    Posts
    14
    No Orange it will never works with my forms, coz the form for Motor insurance order is completely different in DATA,than the life and workers, as you can see an example for the car order sheet>>>> Below
    Click image for larger version. 

Name:	acccess.jpg 
Views:	5 
Size:	70.9 KB 
ID:	17275

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Crosstab Limitation
    By mf28446 in forum Queries
    Replies: 5
    Last Post: 06-18-2014, 10:12 AM
  2. Replies: 5
    Last Post: 01-30-2014, 10:55 AM
  3. Report generation with date limitation
    By MBA80 in forum Reports
    Replies: 5
    Last Post: 06-02-2012, 08:28 PM
  4. Exporting to Excel: Character Limitation?
    By Nosaj08 in forum Import/Export Data
    Replies: 1
    Last Post: 04-21-2010, 10:29 AM
  5. Replies: 1
    Last Post: 03-25-2010, 03:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums