[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

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.
  • 3
  • 3
1 Solution
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
So you want to be able to select an Incident Title and have all the related information for that Incident displayed on the form?

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.Column(0)
If Not rst.NoMatch Then
  Me.Bookmark = rst.Bookmark
  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.
cssc1Author Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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?
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

cssc1Author Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I think the Row Source is the table "1-Incident-tbl"
Open the form in Design view and post the RowSource of the query here.
cssc1Author Commented:
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now