Results 1 to 14 of 14
  1. #1
    cabete is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    7

    Drawing Manager

    Hello everyone.


    I am trying to make a program to manage the drawing at the plant where i work.

    But i am with some problems .
    i want that we depending the choose see the last number and add+1, and right now we its all the time +1 +1 + 1.

    anyone can help

    https://drive.google.com/file/d/1L6Q...ew?usp=sharing

  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,521
    Where exactly? How does one recreate the issue you're experiencing?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cabete is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    7
    Above there is a link for the file in My Driver
    but i make with small translation here.

    https://drive.google.com/file/d/1lYahsuiamYwwrRdD-gA4HwU_1CV5tI4g/view?usp=sharing

    Example:

    A.01.DEC.0004.011.000

    A-Revision 1 if has B its Revision 2
    01 its section of the plant
    DEC.0004 - Machine
    011 - type of tooling from the machine ( electric schematic its 002, etc etc)
    000 - sequencial number


    My problem its the sequencial number its all the time add+1 idependent of the family, but i want verify first last number from the family and add +1

  4. #4
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    try using DMax and adding one.
    https://www.techonthenet.com/access/...omain/dmax.php

    tip: You may get qicker/better responses if you upload DB here instead of using google drive. Many of us wont D\L from outside sites.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    cabete,

    Here is a link to generic document management model from Barry Williams' site.
    It may offer some insight on your tables and relationships.
    I agree with moke123 re providing a sample database within the forum.
    Good luck.

  6. #6
    cabete is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    7
    There it is.
    Without zip are to big for attach

    Database_last - eng.zip

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Click image for larger version. 

Name:	Screenshot 2020-11-01 101704.jpg 
Views:	31 
Size:	14.7 KB 
ID:	43357
    is this the control your talking about?

    if so, just bind the textbox to the field.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  8. #8
    cabete is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    7
    Sorry my knowledge of acess are low and not understand what you say, i see the examples and try to understand it and adapt what i need.

    If i choose
    A.01.DEC.0004.011.(###)
    the value ### must be seen in the table the last number with my choise before , the number for example are A.01.DEC.0004.011.015 the last number .
    Then the number that we will record and will appear must be, 016

    If my choise be completely diferent and not exist that must start at 000.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by cabete View Post
    Example:
    A.01.DEC.0004.011.000

    A-Revision 1 if has B its Revision 2
    01 its section of the plant
    DEC.0004 - Machine
    011 - type of tooling from the machine ( electric schematic its 002, etc etc)
    000 - sequencial number
    In my view you'd be better off storing each of those components in different fields. You're basically storing multiple values in one field, violating a normalization rule (atomicity). With separate fields you have a relatively simple DMax() plus 1 as moke suggested. As is, you have to parse out the sections to find the max for a given combination of the first 4. Not saying it can't be done, but it's more complicated.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    cabete,

    I can't open your database (Unrecognized database format) but,

    Left("A.01.DEC.0004.011.015",18) = A.01.DEC.0004.011. (DwgBase)
    Right("A.01.DEC.0004.011.015",3) = 015
    CInt(Right("A.01.DEC.0004.011.015",3)) = 15
    CInt(Right("A.01.DEC.0004.011.015",3)) + 1 = 16
    Format(CInt(Right("A.01.DEC.0004.011.015",3)) + 1,"000") = 016 (NextNum)

    So, give a try to this query on your table with the drawing codes:
    Code:
    SELECT Left([dwg],18) AS DwgBase, 
    Format(Max(CInt(Right([dwg],3)))+1,"000") AS NextNum 
    FROM tblDwg 
    GROUP BY Left([dwg],18);
    (copy and paste the SQL code above into a new query in SQL view and save it as qryNextNums)

    dwg: The field with drawing code (A.01.DEC.0004.011.015).
    Replace it with the actual name of the field.

    tblDwg : The table with drawing codes.
    Replace it with the actual name of your table.

    So, if a field with the name txtDwg contains the code A.01.DEC.0004.011.015, the next drawing code of A.01.DEC.0004.011. is:
    Code:
    Left([txtDwg],18) & nz(DLookup("NextNum","qryNextNums","DwgBase='" & left([txtDwg],18) & "'"),"000")


    Cheers,
    John

  11. #11
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Theres definitely a language barrier here.

    I'm wondering if what he means is he wants to format that number with leading zeros.

    format(NºDesenho,"000")

    so the entry appears as
    A.01.DEC.0004.011.001
    A.01.DEC.0004.011.002
    A.01.DEC.0004.011.003
    -
    -
    A.01.DEC.0004.011.017
    etc.

    He's using an autonumber for that field so in order to get 000 he'll have to change that.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  12. #12
    cabete is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    7
    Database_last - eng.zip

    All program translated

    see now.

  13. #13
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I agree with Paul post #9. One fact, 1 field. You can concatenate the fields for display when needed.

  14. #14
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Is this what your looking for?
    Click image for larger version. 

Name:	Screenshot 2020-11-02 084634.jpg 
Views:	20 
Size:	73.8 KB 
ID:	43365

    if so change this line of code
    Code:
    Me.GNumber = [TxtRevision] & "." & [TxtSection] & "." & [TxtMachine] & "." & [TxtAssembly] & "." & format([TxtDrawingN], "000")
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

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

Similar Threads

  1. Multiple attachments for each Drawing No
    By masoud_sedighy in forum SharePoint
    Replies: 4
    Last Post: 07-12-2019, 08:48 AM
  2. Quality of Imported PDF Drawing
    By Gizmo88 in forum Access
    Replies: 14
    Last Post: 01-11-2019, 11:12 AM
  3. How to make drawing
    By Suspecious in forum Access
    Replies: 1
    Last Post: 04-09-2013, 11:28 AM
  4. Drawing on form in code
    By taxidev in forum Access
    Replies: 1
    Last Post: 11-10-2011, 11:48 AM
  5. add drawing
    By chiefmsb in forum Database Design
    Replies: 7
    Last Post: 11-12-2010, 08:16 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