Combo box to select record not working

matt467

Registered User.
Local time
Today, 00:44
Joined
Sep 2, 2009
Messages
12
Rightio ive got a form which shows customers details, and i wanted to create a dropdown list so i can scroll and click on a customer.. then shows the details.. simple right?!

-Create the box using 'Find a record on my form based on the value I select'
-Select Company field

All works fine!

However when i close the document, and reopen it.. and try and select a customer it reads this;

Object of class does not support the set of events




Anyone any idea?
 
>>>However when i close the document<<< do you mean "Form"

What I think you are trying to say is that you have created a combo box using the combo box wizard so that the combo box selects a particular record for your form to display.

It worked OK when you first set it up, but now it’s not working properly.

If that is correct then please could you post the code from your combo box after update event.
 
Yeah thats correct, heres the code;

Object type -
Object name -
Record - First
Where Condition - ="[Company] = " & "'" & [Screen].[ActiveControl] & "'"
 
That looks like a macro, I don't do macros!
 
I wonder if that's the exact message you see?

The macro is a simple FindFirst action:
Code:
dim rst as dao.recordset

set rst = me.recordsetclone

rst.findfirst "[Company] = " & "'" & Me.[COLOR=Red]NameOfCombobox[/COLOR] & "'"

if not rst.nomatch then
     me.bookmark = rst.bookmark
end if

set rst = nothing
Put this code in the After Update event of the combo box (i.e. Code Builder) and replace the highlighted bit with the name of the combo box.
 

Users who are viewing this thread

Back
Top Bottom