cssc1
asked on
How to add a combo box on a form so it controls the other data on the form?
The images attached (Form-1 and Form-2)give an explanation of the problem and what I am trying to accomplish.
The Incident Title on the “Condition” form is a working example of what I am trying to accomplish on the Causal form.
RC.zip
Form-1.jpg
Form-2.jpg
The Incident Title on the “Condition” form is a working example of what I am trying to accomplish on the Causal form.
RC.zip
Form-1.jpg
Form-2.jpg
ASKER
yes, that is exactly what I am trying to do.
I added your code to the afterupdate and now I am getting an error and nothing is in the combo box.
I don't know what to do at this point.
Please see attached images and db
error-3077.jpg
error--.jpg
RC-2.zip
RC-2.accdb
I added your code to the afterupdate and now I am getting an error and nothing is in the combo box.
I don't know what to do at this point.
Please see attached images and db
error-3077.jpg
error--.jpg
RC-2.zip
RC-2.accdb
Is Incident_ID a Text value, or a Numeric value?
If it's Text:
rst.FindFirst "Incident_ID='" & Me.Combo26.Column(0) & "'"
Also, what's the RowSource for Combo26?
If it's Text:
rst.FindFirst "Incident_ID='" & Me.Combo26.Column(0) & "'"
Also, what's the RowSource for Combo26?
ASKER
Incident_ID is a Numeric value.
I think the Row Source is the table "1-Incident-tbl" and the field to populate the Combo 26 is "INCIDENT TITLE:".
I hope this helps, thank you
I think the Row Source is the table "1-Incident-tbl" and the field to populate the Combo 26 is "INCIDENT TITLE:".
I hope this helps, thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
more errors.
I am not sure I am doing this part correctly "and post the RowSource of the query here".
Also, what query di I post and where is it posted?
see attached image
error--3.jpg
I am not sure I am doing this part correctly "and post the RowSource of the query here".
Also, what query di I post and where is it posted?
see attached image
error--3.jpg
If so, it looks like you could just find the related Event record, and set the Form's Bookmark to that, which should then show all the related records in the subforms. To do that:
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "Incident_ID=" & Me.YourIncidentTitleCombo.
If Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
Else
Msgbox "Incident not found"
End If
You'd add that in the AfterUpdate event of the Incident combo. I'd suspect the RowSource of the Incident combo would be the same as the Incident combo on the Conditions_1of3_frm.