Results 1 to 5 of 5
  1. #1
    SALPBE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    4

    Arrow Bill of Materials Code Questions

    I am new to the group and to Access, but have been reading through related materials and getting sample code to pull together a Bill of Materials (BOM) from an ODBC data source (Sage MAS90 DB). I found a BOM.ZIP example from which I was able to modify to get the correct information from my sample database.

    What I am having problems with is some basics.

    1. Passing more than one parameter from a combo box.
    2. Dealing with NULL values in the data.
    3. How to place more information into the Array.

    1.
    The sample DB uses a Form to collect information. It originally collected only ONE column of information, but I need to pass TWO items to the Module that assembles the BOM. (The second piece of info is the CurrentRevision of the Assembly)

    I have the following code for the Event Procedure:

    Option Compare Database
    Option Explicit
    Private Sub Combo0_Click()
    Dim strAssembly As String
    Dim intCurrentRev As String
    strAssembly = Combo0.Column(0)
    intCurrentRev = Combo0.Column(1)
    BOMHost (strAssembly) <============
    End Sub

    This works as written (passing strAssembly), but I don't understand how to add the second item intCurrentRev to the BOMHost call.

    Also If and when the parameter is passed to BOMHost, how can I get the information to the Sub so that I can limit the SELECT statement to only the CurrentRevision items.

    Thinking something like:

    Set rs1 = db1.OpenRecordset("Select * from BM2_BillMaterialsDetail Where " _
    & "(((BM2_BillMaterialsDetail.BillNumber)=" & Qu & strBillNumber & Qu & ")AND ((BM2_BillMaterialsDetail.Revision) = " & Qu & intCurrentRev & Qu & "))", DB_OPEN_DYNASET)

    I have attached the code file.

    2.


    In the table that comes from MAS90 (Read Only), there are /C codes in separate columns associated with the BillNumber. For these rows, there are NULL values for the ComponentItemCode and QtyPerBill fields. Since I can't change the information in the table, I need to pass back the /C codes from the BM2_BillMaterialsDetail.C column and not error out because of the NULL values.

    3.
    Idealy, my OutPutTable should have the Assembly, SubAssembly, and component information. I just need an example of how to increase the amount of information passed into the OutPutTable.

    If I have posted incorrectly, please let me know.

    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Without looking at your db, you will need to modify the BOMHost() procedure to accept the second value to do as you are asking.

  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,722
    There are some data models for Gill of Materials here that may be useful

    http://www.databaseanswers.org/data_.../bom/index.htm conceptual
    http://www.databaseanswers.org/data_...ysical_bom.htm physical


    Sample BOM for a paper warehouse
    http://www.databaseanswers.org/data_..._warehouse.htm

  4. #4
    SALPBE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    4
    Thanks for the responses. I have been looking at the links that "orange" posted, but don't really have an issue with the concept of a BOM.

    RuralGuy. You mention that I need to modify the BOMHost() procedure. This is one of my questions. I know I need to modify, but I don't know the correct format.

    Does anyone have a "Specific" resource that would get me going in the right direction?

    I appreciate all the help I can get.

  5. #5
    SALPBE is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    4
    I was able to get past the issue of the procedure not passing the information by removing the () from the call.

    Private Sub Combo0_Click()
    Dim strAssembly As String
    Dim strCurrentRevision As String

    strAssembly = Combo0.Column(0)
    strCurrentRevision = Combo0.Column(1)

    BOMHost strAssembly, strCurrentRevision
    ' Original call BOMHost (strAssembly, strCurrentRevision)

    End Sub


    I still need assistance with the other 2 questions on my original post if anyone has any ideas.

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

Similar Threads

  1. Requesting Materials Report Assistance
    By pkott in forum Reports
    Replies: 2
    Last Post: 10-21-2010, 08:49 AM
  2. Replies: 1
    Last Post: 08-05-2010, 12:01 AM
  3. Bills of Materials / Inventory
    By CRM001 in forum Database Design
    Replies: 4
    Last Post: 05-20-2010, 01:52 PM
  4. VBA code - questions table onto forms
    By Tman in forum Programming
    Replies: 3
    Last Post: 04-26-2010, 05:47 AM
  5. Linking like materials
    By Gborowiec in forum Queries
    Replies: 1
    Last Post: 02-03-2010, 09:44 PM

Tags for this Thread

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