LowNissan,
If you haven't had your question answered here is some sample code from my database. If I understand your question you want to populate a combo box (Mustang, Taurus, Escort) based on a different combo box (Ford). I perform this function in my "Purchase Orders" database. When an employee wants to order a part he chooses a vendor from a combo box. He then goes to a combo box on a subform. This combo box lists only the parts available from that particular vendor. After each part selection the user can modify the quanty and unit price for each item. The driving force for this process is this code which is the "Row Source" property in the second combo box:
SELECT DISTINCTROW [tblProduct].[ProductName], [tblProduct].[ProductID], [tblProduct].[PartNumber], [tblProduct].[UnitPrice], [tblProduct].[VendorName], [tblProduct].[CatNum] FROM tblProduct WHERE ((([tblProduct].[VendorName])=[Forms]![frmOrderEntry]![VendorName])) ORDER BY [tblProduct].[ProductName];
The "After Update" sub in this combo box fills in the other fields with this sub:
Private Sub cboProductName_AfterUpdate()
If Len(cboProductName.Column(1)) <> 0 Then
ProductID.Value = cboProductName.Column(1)
PartNumber.Value = cboProductName.Column(2)
txtUnitPrice.Value = cboProductName.Column(3)
txtVendorName.Value = cboProductName.Column(4)
txtCatNum.Value = cboProductName.Column(5)
Rancor
Else
Exit Sub
End If
End Sub
If user enters an item that is not already in the vendor's list he can add the item on the fly. The "On Not in List" sub takes the user to a form that already has the vendor name and part name filled in. The user just adds the part number, category, price, and clicks OK. The code takes him back to the original form with the new info (except qty) already filled out. The code looks like this:
Private Sub cboProductName_NotInList( _
NewData As String, Response As Integer)
Dim mbrResponse As VbMsgBoxResult
Dim strMsg, VendName As String
VendName = Forms("frmOrderEntry"

("VendorName"

strMsg = NewData & _
" isn't an existing item. " & _
"Add a new item for " & _
VendName & "?"
mbrResponse = MsgBox(strMsg, _
vbYesNo + vbQuestion, "Invalid Item"
Select Case mbrResponse
Case vbYes
DoCmd.OpenForm "frmAddProduct", _
DataMode:=acFormAdd, _
WindowMode:=acDialog, _
OpenArgs:=NewData
Response = acDataErrAdded
DoCmd.Close acForm, "frmAddProduct"
Case vbNo
Response = acDataErrContinue
End Select
End Sub
If you need further assistance email me or call. My phone number & email address (contact webmaster) is at my web site:
Tom