+ Reply to Thread
Results 1 to 7 of 7

Decoding a part number Vs. Read/Write from DB file

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Decoding a part number Vs. Read/Write from DB file

    I have a program I made, which allows users to go through a series of drop down menus, creating a part number, then clicking a button which brings up the build of materials for that part number.

    I now need to add an option where the user can just paste in a part number, and it gives them the BOM. I thought of two ways to do this:

    1. Create code the will "decode" the part number, piece by piece. The issue here is that there are about 10 different formats the part numbers can follow.

    2. Loop my code I already have with a bunch of nested loops, going through each part number option, and creating every single part number there is. Being that there will be millions or part numbers, I will have to export them to a database, and then the user will use a Userform front end, to dump in the file, and find it in the DB file.

    I am thinking about programming it using option 2, but I'm worried that the lookup time will take a while? Any thoughts on this?
    Last edited by hockeyadc; 07-22-2013 at 03:35 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Need help on how to finish my program..

    hockeyadc,

    I would say that decoding the part number is probably the best way to do it. Even if there are 10 different formats, each part number should be unique, so decoding shouldn't be much of a problem. The macro can check for the different format styles and then decode the part number accordingly.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need help on how to finish my program..

    That is what I was thinking, however let me give you an example:

    AIB6UWHST2-10SL-4SS

    AIB6 - Series
    UW- Endbell
    HST2 - Accessory
    10SL - Shell size
    4 - Layout
    S-Sockets
    S-Solder

    All of these variables change, and for instance AIB6 could also be AIB30(so not the same number of characters).

    Then there are different formats to this, for example another part number:

    D38999/26WA9PN-UWHST2

    D38999/26 - Series
    W - Plating
    A- Shell Size
    9 -Layout
    P- Pins
    N- Rotation
    UW-Endbell
    HST2 -Accessory

    As you can see, they change very differently, and I'm having a tough time figuring out how I would set up code to decode each specific part number.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Need help on how to finish my program..

    Is there any reason they are so different? Implementing data normalization would make this a much easier task.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help on how to finish my program..

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need help on how to finish my program..

    Quote Originally Posted by tigeravatar View Post
    Is there any reason they are so different? Implementing data normalization would make this a much easier task.
    This is just how they are setup. There are 10 different varieties of this, and then those are slightly different too. This is why I'm having trouble. How long would it take to do a lookup in a DB file into millions of part numbers from Excel?

  7. #7
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Need help on how to finish my program..

    Quote Originally Posted by Richard Buttrey View Post
    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Where is Edit?

    Edit: I got it.
    Last edited by hockeyadc; 07-22-2013 at 03:35 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Printing a userform and displaying a chart upon finish VBA program
    By damayn83 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-12-2013, 12:55 PM
  2. Replies: 5
    Last Post: 06-30-2011, 03:26 PM
  3. Almost done need help to finish
    By joesport5 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-19-2010, 11:14 PM
  4. Finish Spreadsheet
    By Trying Hard in forum Excel General
    Replies: 1
    Last Post: 05-22-2006, 06:00 AM
  5. Help me finish my project please!
    By Sethaholic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2005, 05:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1