Hello everyone.
I've spent a while searching these forums, and I can't seem to find the solution to my problem.
I have a form that updates a main table in my database. The main table has two ID number fields, that reference other tables. On the form I have a cascading combo box, that inputs the first ID field, and then looks up and prepares the second combo box.
Thanks to the informative FAQ on combo boxes, I figured out how to actually get the second field to reference the first.
It mostly works. The problem is that the form is in continuous view, and anytime the first combo box is changed in any of the forms, the form blanks out all of the second ID fields in any form that is referencing the previous first ID number. It is doing this to make sure the drop down list in the combo box is accurate, and it isn't actually modifying the table.
But it IS confusing my users, who just want a simple drop down interface.
Is there any way to make the second ID field lookup the values in its table, based on the current value in the first field, without changing the format of the rest of the records?
The First ID field, cboContract has the following code:
SELECT Contract.ContractID, Contract.Contract_Name
FROM Contract;
And has the following events tied to it, taken almost word for word from the sample cascading boxes MDB in the FAQ section:
Private Sub cboContract_AfterUpdate()
If IsNull(Me.cboContract) Then
Me.cboDeliverable = Null
Me.cboDeliverable.Enabled = False
Me.cboDeliverable.Locked = True
Else
Me.cboDeliverable.Enabled = True
Me.cboDeliverable.Locked = False
Me.cboDeliverable.Requery
End If
End Sub
Private Sub cboContract_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
End Sub
Finally, my second ID field has the following code:
SELECT Deliverable.DeliverableID, Deliverable.Deliverable_Number FROM Deliverable
WHERE (((Deliverable.Contract_ID)=Forms!Documents!Contract_ID))
ORDER BY Deliverable.Deliverable_Number;
If anyone can point me in the right direction, I'd be very grateful.
Thanks.
I've spent a while searching these forums, and I can't seem to find the solution to my problem.
I have a form that updates a main table in my database. The main table has two ID number fields, that reference other tables. On the form I have a cascading combo box, that inputs the first ID field, and then looks up and prepares the second combo box.
Thanks to the informative FAQ on combo boxes, I figured out how to actually get the second field to reference the first.
It mostly works. The problem is that the form is in continuous view, and anytime the first combo box is changed in any of the forms, the form blanks out all of the second ID fields in any form that is referencing the previous first ID number. It is doing this to make sure the drop down list in the combo box is accurate, and it isn't actually modifying the table.
But it IS confusing my users, who just want a simple drop down interface.
Is there any way to make the second ID field lookup the values in its table, based on the current value in the first field, without changing the format of the rest of the records?
The First ID field, cboContract has the following code:
SELECT Contract.ContractID, Contract.Contract_Name
FROM Contract;
And has the following events tied to it, taken almost word for word from the sample cascading boxes MDB in the FAQ section:
Private Sub cboContract_AfterUpdate()
If IsNull(Me.cboContract) Then
Me.cboDeliverable = Null
Me.cboDeliverable.Enabled = False
Me.cboDeliverable.Locked = True
Else
Me.cboDeliverable.Enabled = True
Me.cboDeliverable.Locked = False
Me.cboDeliverable.Requery
End If
End Sub
Private Sub cboContract_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
End Sub
Finally, my second ID field has the following code:
SELECT Deliverable.DeliverableID, Deliverable.Deliverable_Number FROM Deliverable
WHERE (((Deliverable.Contract_ID)=Forms!Documents!Contract_ID))
ORDER BY Deliverable.Deliverable_Number;
If anyone can point me in the right direction, I'd be very grateful.
Thanks.