Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Propblem with relinking tables

Status
Not open for further replies.

DanielGreenwood

Technical User
May 9, 2002
21
0
0
GB
Hi,

I've got a simple form in MS Access 97 that I use to relink linked tables within my database.

I have a list box that populates the names of all the linked tables in the DB (cboTableName) and a text box that i can enter the new pathway into.

This has been working fine up until today when I get an 'Invalid use of property error'. Its the tbl.Name part that its getting stuck on.

Set tdf.Name = Me.cboTableName

tdf.Connect = ";Database=" & strNewPath
tdf.RefreshLink

Hope you can help as this was a really useful form.
 
If it has been working before without a problem then all the sudden stops working the first place I look is to see if its my References. If something was installed recently it may have affected them.

When a type library is installed on a computer, specific information about it is placed in the registry. Microsoft Access uses this registry information to reference and use the type library. Under normal conditions, installing a newer version of a type library on a computer has no effect on the programs that use it, but in some cases, changes to the type libraries cause them to be registered differently. When this happens, Microsoft Access cannot use them until the new registry information is refreshed in the References collection.
 

I have checked the References but not sure what would have changed or what new libraries I should insert. I can't see why setting the 'Name' property of the table def object would all of a sudden not be valid.

I think I might be able to find a work round by looping through all the linked tables. But would still like to get to the bottom of it...
 
Have you tried to replace this:
Set tdf.Name = Me.cboTableName
By this ?
tdf.Name = Me.cboTableName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV

Yes I did try that. It then kicks out another error:

--
Run time error 91

Object Variable or with block variable not set
--

Usually sticking 'Set' in front of the variable would solve this I think.

If you have any other ideas I would be grateful.
 
How is tdf instantiated ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
HI

"--
Run time error 91

Object Variable or with block variable not set
--
"

to me that suggests the problem lies earlier in the code, at the point when tdf is set eg

Set tdf = ....



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 

I just declare tdf as a table def object:

Dim tdf As TableDef

Am I missing something here?
 
Hi

you need to be "setting" it so it knows which tdf it is dealing with

puzzle here is how did it work before?

might be useful to show us the code, this is woking blindfold and guessing, fun maybe, but productive it is not

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top