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

x
?
Solved

Update a form based on changing from Combo Box

Posted on 2008-11-18
7
Medium Priority
?
471 Views
Last Modified: 2013-11-28
We have a form that has a field called Name which containts a persons name and then in that record is all their personal info. We are using a combo box for the name so you can type in someones name and it will auto fill for you but i need it to update all the other fields on a form when you hit enter or tab out of the field. How is this possible?
0
Comment
Question by:akalbfell
7 Comments
 
LVL 4

Expert Comment

by:Clothahump
ID: 22989553
Add code behind the combo box click event that will read the person table and update the fields accordingly.
0
 
LVL 8

Author Comment

by:akalbfell
ID: 22989600
Thanks for the response. I had assumed this was what was needed to be done but i need help doing it.
0
 
LVL 85
ID: 22989844
Is the form based on a Table/Query? If so, and if your combo contains that ID field from that table/query, then you could do this:

Dim rst As DAO.Recorset

Set rst = Me.RecorsetClone
rst.FindFirst "YourTableIDField=" & Me.YourCombo.Column(0)

If Not rst.NoMatch Then
  Me.Bookmark = rst.Bookmark
End If

Note that the Column property of the combo is zero-based, meaning that the first column is Column(0), the second is Column(1) etc.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 22992097
akalbfell,

What is the purpose of this form?
I think LSM's presumption is that the Name info is only part of the data that this form collects.

To me, this could be a "Personal Info" form (Employee, Student, Member)
In this case what you are describing seems like a "Search" combobox.
You want to type in a name and have the form "Jump To" that record.
(Thus "Completing" the fields)

This combobox SHOULD NOT be the same as the box you actually use to enter new names.

You can use the Combobox wizard.

Drop a combobox on your form.
When the wizard opens select:  "Find a record on my form..."
Then follow the rest of the wizard's steps.

JeffCoachman
0
 
LVL 8

Author Closing Comment

by:akalbfell
ID: 31518043
Thanks so much, exactly what i was looking for and no coding behind it.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22995084
Yes, I had to read your question a few times before I realized that it could have another meaning.
That is why I posted another alternative.

"and no coding behind it."

There IS code that is created by the wizard to do this.
But it was created behind the scenes.
Open the form and press Alt-F11 and find the "After Update" code for the combobox.
;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22995103
Yes, I had to read your question a few times before I realized that it could have another meaning.
That is why I posted another alternative.

"and no coding behind it."

There IS code that is created by the wizard to do this.
But it was created behind the scenes.
Open the form and press Alt-F11 and find the "After Update" code for the combobox.
;-)

JeffCoachman
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question