# BOM Form Documentation ## Overview The BOM (Bill of Materials) form provides functionality for reading, displaying and managing BOM data from different sources. ## Form Controls ### Text Fields - `txtAssembly` - Assembly number input (8 characters - part number and revision) - `txtBOM` - Full path and filename of BOM file - `txtGood` - Status indicator field ### Buttons - `cmdReadBOM` - Reads standard format BOM files - `cmdReadAltimaBOM` - Reads Altima format BOM files - `cmdReadSolidBOM` - Reads SolidWorks BOM files - `cmdClearBOM` - Clears existing BOM records - `cmdShow` - Displays loaded BOM data - `cmdHide` - Closes the form - `cmdClose` - Closes the form ### Data Display - `DataGrid1` - Displays BOM records with columns: - WASM# (Assembly Number) - WASMR (Revision) - WCMP# (Component Number) - WQTY (Quantity) - WENTD (Entry Date) - `lstStatus` - Status and logging messages - `lblStat` - Status label ### Data Connection - `Adodc1` - ADO data control connected to EGBWP1A0 table via ODBCrms DSN ## Key Functions ### BOM Reading - Standard BOM format (cmdReadBOM_Click) - Parses fixed width format files - Handles Part and Sub-Assembly records - Altima BOM format (cmdReadAltimaBOM_Click) - Parses CSV format files - Skips header rows - SolidWorks BOM format (cmdReadSolidBOM_Click) - Parses tab-delimited files - Handles ItemNo, PartNo, Qty fields ### BOM Management - Clear BOM (cmdClearBOM_Click) - Removes existing records for an assembly - Uses stored procedure for deletion - Show BOM (cmdShow_Click) - Filters grid to show specific assembly/revision ### Logging - Uses loglist() function to: - Display status messages - Maintain history in lstStatus - Limit list to 600 entries ## Data Format - Assembly numbers: 7 digits + 1 revision character - Quantities stored with 3 decimal places - Dates stored as YYYYMMDDHHNNSS ## Error Handling - File existence checking - Error trapping for database operations - Status codes for operation results: - 0: Success - 1: Bad BOM format - 2: File not found