Frustrating error!!!

  • Thread starter Thread starter kels
  • Start date Start date
K

kels

Help!!!!

I've got a form that uses an after update code to automatically generate
information based on what I choose from a combo box.

Anyway, whenever I change anything on the form i.e add another field I get a
really frustrating error message and I cannot get rid of it!

the message I get is "the expression After Update you entered as the even
property setting produced the following error: Object or class does not
suport the set of events.

Any ideas?
 
kels said:
Help!!!!

I've got a form that uses an after update code to automatically
generate information based on what I choose from a combo box.

Anyway, whenever I change anything on the form i.e add another field
I get a really frustrating error message and I cannot get rid of it!

the message I get is "the expression After Update you entered as the
even property setting produced the following error: Object or class
does not suport the set of events.

Any ideas?

Post your AfterUpdate code with a description of any referenced objects.
 
Hi Rick, this is the code that's in the afterupdate section of the combo
box....

Private Sub cboEvent_AfterUpdate()
Me.[EventPrice] = DLookup("[EventPrice]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[StartDate] = DLookup("[StartDate]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[EndDate] = DLookup("[EndDate]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[StartTime] = DLookup("[StartTime]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[EndTime] = DLookup("[EndTime]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[Notes] = DLookup("[Notes]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[Venue] = DLookup("[Venue]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
End Sub

Private Sub ComboDelegate_AfterUpdate()
Me.[Organisation] = DLookup("[OrganisationName]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Title] = DLookup("[Title]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Organisation Type] = DLookup("[Organisation Type]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Country] = DLookup("[Country]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
End Sub
 
kels said:
Hi Rick, this is the code that's in the afterupdate section of the
combo box....

Private Sub cboEvent_AfterUpdate()
Me.[EventPrice] = DLookup("[EventPrice]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[StartDate] = DLookup("[StartDate]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[EndDate] = DLookup("[EndDate]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[StartTime] = DLookup("[StartTime]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[EndTime] = DLookup("[EndTime]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[Notes] = DLookup("[Notes]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
Me.[Venue] = DLookup("[Venue]", "[qryEvents]",
"[EventID]=Forms![Bookings]![cboEvent]")
End Sub

Private Sub ComboDelegate_AfterUpdate()
Me.[Organisation] = DLookup("[OrganisationName]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Title] = DLookup("[Title]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Organisation Type] = DLookup("[Organisation Type]",
"[tblContacts]", "[ContactID]=Forms![Bookings]![ComboDelegate]")
Me.[Country] = DLookup("[Country]", "[tblContacts]",
"[ContactID]=Forms![Bookings]![ComboDelegate]")
End Sub

My first guess would be that one or more of those DLookups() is returning a
Null value and it is being assigned to a field that does not allow Nulls.
That will give you an error.
 
Hi Rick, thanks very much!

I actually solved the problem this afternoon. I had two versions of Access
installed, 2007 and 2003, I uninstalled 2007 and as soon as I did that I
opened up the database in 2003 and immediately it installed components that
it was obviously missing and now it works a treat :O)
 
Back
Top