Run-timer error '2001'

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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)
 
Back
Top