Results 1 to 5 of 5
  1. #1
    tooold is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7

    Question How to avoid mistakes in a database? Please help

    1. I have two (2) fields: Order_Code (number) and subOrder_Code (text). In a way, users would make input on both fields and at the latter stage, these 2 field would combine together for the records. My problem is: how can I make it to avoid repeating of the 2 fields? For example:Order_Number: 1000, subOrder_Number: b. Questions: How can I joint it to become: 1000b, and this kind of order cannot be repeated?

    2. Originally, I want to make an incremental value by 1 for the Order_Code, which was text rather than number, so on frmOrder, onload, I put these codes:
    [code] Me.Order_Code = Nz(DMax("val([Order_Code])", "[Orders]"), 0) + 1 [code]
    But the damn thing doen't work, stoped at 1000.


    Quetion: Is there any way to fix this (combination of numbers and letters, increasing by 1 and not reaping)?
    Thanks for all helps

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It sounds like the data type of that field is text. Is this homework or are you cross posting, since this post is hauntingly similar to another?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tooold is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    Paul,

    Just cross posting. Sorry. But I got stucked with the problem for two days already. The shop just been set up and running sir, orders are comming in need to solve the issue real quick

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Then you already know that the cause of this issue is the data type. Change it to a numeric data type.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    tooold is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    Yes sir. I did just that. But still stucked with problem: how can i join the two field together and make sure they will not repeat each other during the data input

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

Similar Threads

  1. how to avoid #Div/0! error
    By lugnutmonkey in forum Queries
    Replies: 6
    Last Post: 04-17-2013, 01:58 PM
  2. avoid sql server authentication
    By JJCHCK in forum Programming
    Replies: 0
    Last Post: 02-23-2012, 10:36 AM
  3. How do I avoid multiple entries
    By schwabe in forum Queries
    Replies: 2
    Last Post: 02-01-2012, 04:16 PM
  4. How To Avoid Using Three Field Composite Key
    By Lady_Jane in forum Database Design
    Replies: 14
    Last Post: 08-17-2011, 03:40 PM
  5. Design multi user database - avoid simultaneity transactions
    By snoopy2003 in forum Database Design
    Replies: 2
    Last Post: 02-27-2011, 12:03 AM

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