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

x
  • 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.
RC.zip
Form-1.jpg
Form-2.jpg
0
cssc1
Asked:
cssc1
  • 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
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.
0
 
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
error-3077.jpg
error--.jpg
RC-2.zip
RC-2.accdb
0
 
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?
0
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
0
 
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.
0
 
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
error--3.jpg
0

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