I have a couple questions on my VBA code below.

The form offers up a combo box with a list of Manufacturers, and depending on the Manufacturer chosen, it updates a combo box of Models. The Manufacturer combo box is unbound, the Model box is bound to a DetailID in the MachineDetail table.

When the Model box is updated, it logs the data in the MachineDetail box successfully.

When the entire form is completed, it is saved and closed. When it is reopened, the Manufacturer and Model combo boxes are empty.

I also have a Customer combo box that is bound to a CustomerID in the MachineDetail table. This looks up values that are inserted into the form. When the form is saved, again, all the boxes (including the combo) show up empty.

Is there an action I can include in the form to keep these values visible?

Thank you,


Private Sub cbManufacturer_AfterUpdate()
Me.cbModel = ""
End Sub

Private Sub cbCustomer_AfterUpdate()
On Error Resume Next

If cbCustomer.Value > 0 Then
Me.txtBillAddress = DLookup("[CustomerBillToAddress]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtBillCity = DLookup("[CustomerBillToCity]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtBillState = DLookup("[CustomerBillToState]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtBillZip = DLookup("[CustomerBillToZip]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtShipAddress = DLookup("[CustomerBillToAddress]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtShipCity = DLookup("[CustomerBillToCity]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtShipState = DLookup("[CustomerBillToState]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtShipZip = DLookup("[CustomerBillToZip]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtPrimaryPower = DLookup("[PrimaryPower]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtSecondaryPower = DLookup("[PrimaryPower]", "Customer", "[CustomerID]=" & cbCustomer.Value)
Me.txtLineReading = DLookup("[LineReading]", "Customer", "[CustomerID]=" & cbCustomer.Value)

End If

End Sub