Results 1 to 4 of 4
  1. #1
    usselite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    5

    Auto number form

    Hello,

    I am building a database at the moment to pick up orders for a pizzeria. I made the following tables:

    Order:
    id
    customer_id
    date
    total_price

    Billing:
    id
    order_id


    menu_id
    number

    Menu:
    id
    name
    summary
    price

    I made a form in Access 2010 with an subform in it to pickup the order. But the problem is whenever I make an order it doesn't give me an Order.id at the start, so it wont be filled in at Billing.id when someone is taking the order. If I fill in manually something in Order.id it does work and the id is also saved at Billing.id when taking the order.

    Autonumber doesn't seem to work for me because I don't want any user interaction to finally get an unique id, it needs to be filled in when the form is opened. I searched now on the internet for a while and i've read something about Dmax. But I didn't get it working in a textbox or number field.

    I need some help! Thanks.

    I use Access 2010, English, 64 Bits.

  2. #2
    TheShabz is offline Court Jester
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2010
    Posts
    1,368
    You should be able to force an autonumber-esque system by setting a textbox =DMax("IDField","TableName") + 1

  3. #3
    Estuardo's Avatar
    Estuardo is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Portugal
    Posts
    22
    G'd evening,
    You may want to try the current event to get a new id from where ever your id's are. The code posted by Shabz will do the job.
    G'd luck

  4. #4
    usselite is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    5
    Ok, i've tried to fill it in at a few possible places. But I can't find out now where to fill it in exactly? In code (VBA) it does not work. I'm quiet new to Access.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-27-2011, 09:25 AM
  2. Replies: 1
    Last Post: 07-27-2011, 09:19 AM
  3. Number Filed in Form auto round
    By blueraincoat in forum Forms
    Replies: 9
    Last Post: 04-11-2011, 06:18 AM
  4. AuTo NuMbEr
    By Evgeny in forum Forms
    Replies: 2
    Last Post: 04-25-2010, 04:23 AM
  5. Need help with an auto number
    By Wrangler in forum Database Design
    Replies: 1
    Last Post: 02-10-2006, 03:21 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