Method or data member not found - Access 2003 (1 Viewer)

tvf375

New member
Local time
Yesterday, 18:40
Joined
Oct 28, 2014
Messages
1
Hi,

I've been trying to fix this for sometime, but to no avail. I'm working in Access 2003, with a pair of inherited databases. These have a few problems, as you'll see, but they serve their purposes relatively well,

One of these databases is the "current" file, the other is a back up copy of the same file. The guys in the team seem to have been using the back-up file instead, and have quite a large amount of new data in there now (there is nothing new in the current file) so thats the one we are going to go with moving forwards.

It has a problem though - I get the following error upon a certain event triggering:

"Compile Error: Method or data member not found".

The code is below:

Private Sub Combo55_AfterUpdate()

Me.Address1 = DLookup("[Address1]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Address2 = DLookup("[Address2]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Town_City = DLookup("[Town/City]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.County = DLookup("[County]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Postcode = DLookup("[Postcode]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Country = DLookup("[Country]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Phone = DLookup("[Phone]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Fax = DLookup("[Fax]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Website = DLookup("[Website]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.Level = DLookup("[Level]", "tblCompany", "[CompanyID]=" & Me.CompanyID)
Me.ContactType = DLookup("[ContactType]", "tblCompany", "[CompanyID]=" & Me.CompanyID)

End Sub

and Me.Town_City is highlighted when debugging. The strange thing is that despite apparently no changes in the code above or in the table "tblCompany", the script runs successfully in the other non-back up version of the file. The field name in tblCompany is the same (Obviously a slash in a field name is a terrible idea, but I can't change it now), and I've literally copied and pasted the code from the working database to make sure its the same.

Really don't know what else it could be, so any ideas would be much appreciated.

Thanks,

Tom.
 

MarkK

bit cruncher
Local time
Yesterday, 18:40
Joined
Mar 17, 2004
Messages
8,181
Welcome to the forum

Check if someone deleted a control called Town_City off the form.
 

Users who are viewing this thread

Top Bottom