Update a DLookup in a fields

I am currently using the below code for a field on a form. It works perfect when we click to a new form. If we update the combo box: cmOffice it doesn't update the DLookup. Is there an "After Update" event I can add for the cmOffice?

The name of the field that needs updated is: txtOfficeName
cansevinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Rey Obrero (Capricorn1)Commented:
< Is there an "After Update" event I can add for the cmOffice? >

oh, Yes.
in design view of the form, select the combo cmOffice and hit F4
select the Event tab and look for the After Update
select [Event Procedure] from the dropdown, then click on the  ... button to open the VBA window where you can place the codes to run in the After Update event of the combo box.. something like this

Private Sub cmOffice_AfterUpdate()
'place your codes here

End Sub

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
PatHartmanCommented:
Rather than using DLookup() at all, you may be able to include the lookup table in the query you use as the RecordSource for the form.  The join is more efficient and it allows you to pull multiple columns at once rather than having to use multiple DLookup() if you have multiple fields to display.
cansevinAuthor Commented:
Thanks Ray... what would the code be? I need it to update DLookup in the txtOfficeName field. Is there a code for that? I apologize if I am not making sense in my question!
Jeffrey CoachmanMIS LiasonCommented:
I am currently using the below code
?
You did not post the code,
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.