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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I skip or remove the unique identifier when linking a table

Status
Not open for further replies.

trevordupuis

Programmer
May 3, 2006
3
CA
Hi all,

I have linked a table from a ODBC connection through vb in access. However the "Unique Identifier" pops up still. Is there a way to skip this or just have vb click OK for me?

Thanks
 
Well without the "unique identifier" you will probably run into problems trying to save changes in certain situations, so you can't ignore it.

I don't know of a programmatic way of doing it (and how would you be able to tell it which field is the correct identifier in any case?).


 
Thanks for your response.

So instead of skipping the unique identifier is there a way to press the ok button within programming?
Perhaps a sendkeys type function?

 
Unique Identifier" is popping up probably because there is no primary key defined on the table. If you are able to do so, I would create a primary key on the source table.

Also, can't you just set up the link once manually? Is there a reason you need to set the link programmatically?

 
Thanks for the help Joe. So what about going with a refreshtable link?
What would the code be?
I.E. docmd.refreshlink, table?
 
For a table named "Test"

CurrentDB.TableDefs("Test").RefreshLink

If you needed to change the connection string first:

CurrentDB.TableDefs("Test").Connect = "Whatever the connection string should be"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top