how to Find a record on my form based on the value I selected in my combo box

I placed a combo box ( Combo31 ) on form Causal Factors (Causal_Factors)  and I am trying to have the combo box “Find a record on my form based on the value I selected in my combo box”. The values are the field “INCIDENT TITLE:”  in the “1-Incident-tbl” table.
When I go to Add Existing Field the “INCIDENT TITLE:”  field is not listed.

I have uploaded the DB twice. Once with no ZIP and one that is zzipped
Root-Cause-Analysis-for-Tunnel-Construct
Root-Cause-Analysis-for-Tunnel-Construct
cssc1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helen FeddemaCommented:
The combo box should be unbound, and have a row source that is the same as the form, or a subset of it.  Usually the first column is an ID field (set its width to zero if you don't want to see it in the drop-down list), and the 2nd column shows something meaningful for selection.  Here is some standard code:
Private Sub cboSelect_AfterUpdate()
'Created by Helen Feddema 29-Apr-2011
'Last modified by Helen Feddema 29-Apr-2011

On Error GoTo ErrorHandler

   Dim strSearch As String

   'For text IDs
   strSearch = "[______ID] = " & Chr$(39) & Me.ActiveControl.Value _
      & Chr$(39)

   'For numeric IDs
   strSearch = "[______ID] = " & Me.ActiveControl.Value

   'Find the record that matches the control
   Me.Recordset.FindFirst strSearch

ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in " & Me.ActiveControl.Name & " procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub

Open in new window

0
cssc1Author Commented:
Helen,
   I did all that I know about the code you gave me. See the attached.
Root-Cause-Analysis-for-Tunnel-Construct
Root-Cause-Analysis-for-Tunnel-Construct
AfterUpdate.png
Code-.jpg
0
Helen FeddemaCommented:
I modified the combo box AfterUpdate event as needed, but it won't work with Incident_ID, because that is not the key field for the table.  You need to use the key field, which for this table is Event_ID, so I used that instead.  I also put this field on the form, since you have an Event_Description field filled with data that is misleading (it says "this is event no. 3" for Event_ID 1, and so forth, which is confusing).  The modified database is attached.
HBF-Modified-DB.zip
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Helen FeddemaCommented:
Also, I suggest giving all controls meaningful prefixes.  My freeware LNC Rename add-in does this semi-automatically; you can download the version for your Office version from one of these links:

Access 2000 - 2003:
http://www.helenfeddema.com/Files/code10.zip
http://en.wikipedia.org/wiki/Leszynski_naming_convention

Access 2007 - 2013:
http://www.helenfeddema.com/Files/code63.zip
0
cssc1Author Commented:
Thanks Helen.

I appreciate your help and advice.
0
cssc1Author Commented:
Thanks Helen.

I appreciate your help and advice.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.