As far as the drawing and part numbers themselves, they can be anything.
The AssemblyKitNumber is not in use, so I can literally take that out of the rowsource. It was an experiment that ended up not being suitable with Access.
I tried your code and I (THINK) I adjusted it correctly for all the alternates. It didn't work. See below.
Here's what I got:
Here's what I would like:
Here's the code I modified (I probably did it wrong, hehe):
Code:
'If there is an AlternateA, Add AlternateA
If Not (Me.txtAlternateA & "" = "" And Me.txtCageCodeA & "" = "") Then
CurrentDb.Execute "INSERT INTO BOM(Component, Description, UOM, CageCode) " & _
" VALUES ('" & Me.txtAlternateA & "','" & Me.txtAltADescription & IIf(IsNull(Me.cboComponent.Column(1)), ", REF: " & Me.cboComponent, "") & " \ALT" & "','" & Me.txtAltAUOM & "','" & Me.txtCageCodeA & "')"
End If
'If there is an AlternateB, Add AlternateB
If Not (Me.txtAlternateB & "" = "" And Me.txtCageCodeB & "" = "") Then
CurrentDb.Execute "INSERT INTO BOM(Component, Description, UOM, CageCode) " & _
" VALUES ('" & Me.txtAlternateB & "','" & Me.txtAltBDescription & IIf(IsNull(Me.cboComponent.Column(1)), ", REF: " & Me.cboComponent, "") & " \ALT" & "','" & Me.txtAltBUOM & "','" & Me.txtCageCodeB & "')"
End If
'If there is an AlternateC, Add AlternateC
If Not (Me.txtAlternateC & "" = "" And Me.txtCageCodeC & "" = "") Then
CurrentDb.Execute "INSERT INTO BOM(Component, Description, UOM, CageCode) " & _
" VALUES ('" & Me.txtAlternateC & "','" & Me.txtAltCDescription & IIf(IsNull(Me.cboComponent.Column(1)), ", REF: " & Me.cboComponent, "") & " \ALT" & "','" & Me.txtAltCUOM & "','" & Me.txtCageCodeC & "')"
End If