Run-timer error '2001'

G

Guest

I get an error message: "Run-time error '2001': You canceled the previous
operation"

Here is my code...

Private Sub Combo82_AfterUpdate()
Me.address01.Value = DLookup("Address1", "SchoolListing", _
"CEEB_CODE = " & Me.Combo82.Value)
End Sub

What is wrong?

The idea is that I choose a school from the combo box (named "combo82" that
lists all the schools from the "SchoolListing" table) and the combo box's
AfterUpdate event tells a separate text box (named "address01") to display
the address (Named "Address1" in the "SchoolListing" table) associated with
this school.

Any help would be awesome!
 
G

Guest

There is no need to the dlookup.

Add to the row source of the combo the Address1 field
Select CEEB_CODE , Address1 From SchoolListing

If, its not already like it.
On the after update event of the combo you can write
Me.address01 = Me.Combo82.column(1)

Or, in the control source of the address01 field you can write
=Combo82.column(1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top