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

Link BE tables conditionally

Status
Not open for further replies.

YewNork

Technical User
Aug 6, 2001
33
CA
Scenario:
FE distributed among multiple users
2 BEs on network, 1 of which is used by all. The other BE is restricted (by network permissions) to a subset of users.
I would like thru code to only attempt to link to the 2nd BE only if logon id = xxxxx.
Can this be done?
Currently I distribute 2 copies of the FE, one with a subform linked to the 2nd BE.
If this makes sense I look forward to comments. Otherwise I look forward to clarifying.
TIA

LDS (TELUS)
 
Hi

Yes, it can be done you can get the Network Login Id via an API call, or using the Environ() function,

once you have that, if you already know how to link tables in code (which I assume you do), then you are home and dry

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks for the info.
I have the Network Logon ID (for display on the user's form, but I'm not sure on linking tables in code. Both how to & when to. Should I not link via tools | database utilities | linked table manager?
Thanks again.

LDS (TELUS)
 
Hi

The impression I had from your question was that you would need to link in code, you do not want your users fiddling about with link table manager

You can link in code using DoCmd.TransferDatabase, or if you are using DAO by setting the .connect property of the tabledef to an appropriate value

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi, thanks for the reply & sorry about the delay.
I'm OK with link table manager for everything else. It's just that one subform (on a subform, on a tab control) has sensitive info. It's source is a .mdb on a network folder with permissions for only some of the users.
I think I'm OK with linking through code (now). Now I'm curious as to when to do it. I'd like to leave the subform in place (if possible) & toggle it's .visible property depending on who the user is.
My thought is to link the form to the .mdb or make it's .controlsource "" if the .mdb is not available.

Thanks for any suggestions.

LDS (TELUS)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top