Help With Link Code Please...
Dec 28, 2007
I have a FE database that on initial setup the user will enter the drive letter of the mapped location where the BE resides. The FE will then update all the linked tables to that path. This should work but for some reason the FE locks up (stops responding) when I test this. Any suggestions as to why. It doesn't stop responding until this part of the code:
tdf.Refreshlink
I have looked and it does change the link path, but it locks up.
Dim dbs As DAO.database
Dim dataPath As String
Dim tdf As DAO.TableDef
dataPath = Me.drive & ":IMP1_R2.2_be.mdb"
For Each tdf In dbs.TableDefs
'Not a MSys type table
'If the table has a connect string, it's a linked table.
If Len(tdf.Connect) > 0 Then
If InStr(tdf.name, "MSys") = 0 Then
tdf.Connect = ";DATABASE=" & dataPath
End If
err = 0
On Error Resume Next
tdf.RefreshLink
End If
Next tdf
DoCmd.Echo True, "Done"
View Replies
ADVERTISEMENT
Feb 7, 2007
Hey everyone I'm new here but pretty familiar with Access etc. I am extrememl;y stumped on this and I have never attempted this so any answers and details would be helpful. As we all know this is a learn new things as you develop type of application or at least for me.
I have a database that exists in one building and is functionnig fine using linked tables (File/Get External Data/Link Tables) but I now need to make this same application work for multiple locations which each have its own tables that are seperate from each other location. I was thinking a Main form that opens with radio buttons and based on the one you select would determine which tables it would be linked to when it opens. I figured Radio1 be SEDC, Radio2 be SWDC.
I have a database I have setup as a storage database for just the tables for each location that are on different servers in each location to increase traffic speeds.
Example:
SEDC (RadioButton1)
SEDC Database is located on a erver with 50 different tables in it "//sedc1/data/shared/warehouse/SEDC Warehouse.mdb"
SWDC (RadioButton2)
SWDC Database is located on server with same tables in it but different data for that location "//swdc1/data/shared/warehouse/SWDC Warehouse.mdb"
So on So on...
View 3 Replies
View Related
Sep 13, 2005
I am having trouble with a simple data base where I have 1 main form with 1 sub form, but when I try to use the form (go from design view to datasheet view) I get the message
Error Accessing File
Network Connection May have been lost.
and the link between the form and the code seems to have been lost ... I can no longer edit the vb code (it keeps reverting back no matter what I type).
When I delete the form, the VB entry remains - (since it is no longer linked with the form). Running the database this way I get error messages saying there is a Macro with a misspelled name (ie: it can't find the form with the name).
The only way I have been able to get rid of it is to create a new form with nothing in it, save it and then delete it.
Really frustrating!!!!
Any ideas on how I can get rid of this problem, best ways to re-build the data base (I have created a new one, imported the tables and created new forms from scratch ... then this problem comes back@&^^#%$@).
Thanks
View 1 Replies
View Related
Jan 19, 2005
Hi
I am linking av table from Sybase Adaptive server anywhere 8.05 by using this code:
DoCmd.TransferDatabase acLink, "ODBC", "odbc;DSN=database;UID=dba;PWD=sql;DATABASE=databas e", acTable, "trc.ansatt_dato", "trc_ansatt_dato", False
This works just fine, but I gety this dialogbox where I am asked to select a unique keys or something.... .
Is it possible to write a code to automatic choose OK?
Anyone?
eroness
View 2 Replies
View Related
Mar 4, 2005
i have two tables that only need to exist for the length of the user's session. i build them with ADOX in my backend database when the user starts up, and destroy them with ADOX when the user closes the application. the name of the table created varies, too, depending on the user (userID is built into table name).
i need combo boxes on my forms in the front end to be able to access this data.
is there a way in code, once the temp tables are built, to create a 'link tables' type of setup?
my alternative is to build the temp tables in the front end portion, but i don't really want to do that.....
View 4 Replies
View Related
Jan 29, 2008
I'm trying to figure out how to link a text file to my database with VBA. I know how to do this for other types of data sources, using the DoCmd.TransferDatabase acLink command, but need guidance using this with TXT files.
Thanks,
Randy
View 3 Replies
View Related
Oct 21, 2004
Through word of mouth I hear that you can creat a link that can go from Access and link to the personal company system. Is this true? If it is, is there a standard code to use?
View 2 Replies
View Related
Oct 13, 2006
I searched and couldn't find anything on this specific issue.
I'm on the verge of designing a pretty big database and I've run into what may become a bit of a problem. There will probably be several backends in different locations. Should another backend ever be created or if the location for one changes, the user can use a form to refresh the links to the tables on that specific database.
The way I've done this so far is by having a piece of code that checks the tables for a connection string. If the table has a connection string, its a linked table, so the link gets deleted and replaced with the new link. Well this will no long work since there will be several backends and only 1 of them may need its tables relinked and using that code will delete all the table links, including the good ones.
Is there a way to make 'DoCmd.TransferDatabase' overwrite table names instead of giving the duplicate tables a number suffix? I think that doing this would be easier than retrieving the table names from the new backend and comparing them with the linked table names in the frontend so the old links could then be deleted.
View 1 Replies
View Related
Feb 16, 2006
Works great, but when I hit the number "3", (3 times in row) it will let me into the form. I want it to not let me in IF I don't know the password.
Where did I go wrong?
Private Sub Form_Load()
Dim pw As Variant
If InputBox("What is the password?", "Password") = "1" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
If InputBox("What is the password?", "Password") = "2" Then
Else
MsgBox "Invalid Password", vbCritical, "Sorry Charlie"
DoCmd.Close
End If
End If
End Sub
View 14 Replies
View Related
Jan 14, 2007
I protect my code from people being able to read it by setting a password on the code from Tools > Properties, selecting the Protection tab and entering a password, and clicking "Lock Project"
Is there a way to write code that will remove that Lock Project check and check it back on?
I've looked through the Application.SetOption command and it doesn't seem to be one of the choices. It would be very helpful if someone knew how to do this.
Thanks
SHADOW
View 6 Replies
View Related
Aug 8, 2005
Folks,
i have a small problem wizzing my nut. I copy two tables from mycurrent database to an external database,now i am trying to link these two tables in the external database to the ones in the currentdb. I get a run-time error 3012 telling me that an object 'tblLanguage' is already present.which iam failing to track. Any ideas Please??
Here is my linking code.
Sub LinkMeUp()
Dim tbl As DAO.TableDef
Dim sTableName As String
Dim sThatTblpath As String
Dim dbName As String
dbName = "my_ExternalDatabase"
sThatTblpath = ";Database=" & db_Path & "" & dbName
For Each tbl In CurrentDb.TableDefs
sTableName = tbl.Name
Set tbl = CurrentDb.CreateTableDef(sTableName)
tbl.Connect = sThatTblpath
tbl.SourceTableName = sTableName
CurrentDb.TableDefs.Append tbl
Next tbl
End Sub
View 3 Replies
View Related
Aug 2, 2006
Hello,
The current database I am working on I made it by copying the one I was working on originally. I just realized on the VB window that there is still some relation between them. Because, if I look at the tree on the left of the code window I see it says "GCB (miniGCB)", being GCB the one I copied, and miniGCB the one I am working with.
How can I get rid of the link with GCB?? I want the tree to just say "miniGCB".
Thanks,
View 1 Replies
View Related
Jan 17, 2006
Hello all,
I created a table and linked a pdf file to one of the fields, but when I created a form to display the table contacts, I could not see the attachment or icon or any reference to the linked object. The field in my access table is an OLE object.
Thanks for helping out.
View 7 Replies
View Related
Aug 31, 2005
I have packaged an Access DB (Split) as a run time solution so I can distribute to users without Access.
When I install it on a PC it runs.
If I move the back end to a network, the solution can't find the back end because it has been moved.
Access run time does not include the linked table manager in the toolbar.
Is there code in VBA where I can refresh the link between front and back end.
Ideally I want to write an error handler that will call a sub to prompt the user for the new location of the back end if it has been moved. Then have the user browse to the network location and click on the back end and store that location as a string. Using that string refresh the links.
Any ideas on that?
View 5 Replies
View Related
Nov 3, 2005
Hi all,
I have added about 15 links on a form, linking to word and excel documents. The word documents open fine but all of my excel documents pop up with a messae saying the file cannot be open, yet when i just go to the document on my hard drive they all open fine...does anyone have any ideas please. Thanks
View 6 Replies
View Related
Apr 11, 2006
Hi,
I'm new to this so please go easy!
I have an excel document which automatically refreshes data gathered from an access db.
I need to put a button on the switchboard on the same db to open the excel document, basically to make it easy for others to find.
I have tried hyperlinks but it doesn't want to play. It locks the db and then won't refresh the information.
I know i'm missing something blindingly obvious, can someone help?!
:confused:
Thanks
elsiegee
View 1 Replies
View Related
May 13, 2006
Hi Forum,
I'm building a db to track computer and user problems for work, where I double as a Client Support Administrator (IT Guy).
I have these tables: (simplified list)
tblComputers
tblPeople
tblCompAssignment
tblProblems
I'm at a loss as to how to link the 'Problems' table. This is where I'll record trouble tickets reported by users.
Incoming trouble tickets could relate to the Computer or to the User's Network Login.
I thought I might have a field in the problems table for UserName and also one for ComputerID, but this seems problematic. Anyone got any ideas?
View 12 Replies
View Related
Jun 29, 2006
I am trying to link to a url from a message box with difficulty.
eg the user opens the form and a message box appears asking have the latest datasets been downloaded? If answered yes the form opens, if no links to web address.
has anybody any examples.
Thanks
View 2 Replies
View Related
Apr 12, 2008
I have a database which works as an information system for the upcomming olympics.
In tblAthletes is...
AthleteID (Primary Key)
FirstName
Surname
And Various other fields not needed in this problem
In tblResults is...
Gold
Silver
Bronze
Also other field in this table
What I am aiming for is to have Gold AND Silver AND Bronze all as foreign keys of the AthleteID field.
Is there a way to do this or can another way be suggested. I am working on the 2000 version of access.
View 5 Replies
View Related
Dec 24, 2005
Hi There
i am trying to link some more tables to my access front end from the sql server back end
when i select 'ODBC Databases' from the link pop up box, the pop up box just closes
any ideas why, or work arounds would be appreciated
Happy Christmas
View 4 Replies
View Related
Jun 20, 2006
Does anyone know how to link tables automatically/VBA?
I'm trying to import files from our DB2 database in which one file is created monthly and instead of manually importing / linking the files manually, I'm looking to have access link to the new file automatically.
The file names are structured as so..
ITM01 (Jan)
ITM02 (Feb)
ITM03 (March)
Thanks
View 5 Replies
View Related
Sep 14, 2006
Hello everybody,
I have one dbase with 3 tables wiht 3 forms. One is "custonmers" , "glass" and "lens".
Customers - CusID as primary Keys
Glass - GlasID and CusID primary keys
Lens - LensID and CusID Primary Keys
When I change a specific field (only) I am losing the records on the other tables of the specific customer.
Thanks in advance
xxx ΠΑΟ ΘΡΗΣΚΕΙΑ ΘΥΡΑ 13
View 2 Replies
View Related
Mar 3, 2007
Hi All
I enter data in a form "WIP" that is based on a table named "WIP" in the form I have a command button. When I activate the command button it takes me into another form "Materials" which is based on a table named "Materials".
The data that I enter into "Materials" is not linked to the data ie Customer details which I have entered into "WIP".
My aim is to be able to report the materials used.
I have tried variations of relationships but am obviously missing something.
Thanks in Advance
Geoffk
View 2 Replies
View Related
Jun 5, 2007
Is it possible i create one master table and link few table together??
In the mdb that i attached there have 3 table - tblMaster, tblConfiguration1 and tblConfiguration2.
Using the relationship to link tblMaster's field Configuration to other 2 table Configuration field but there only showing 1 table data.
Is it allow in tblMaster able to show this 2 table together??
View 5 Replies
View Related
Dec 7, 2005
Hi
i would like to link to a query. when i go to file | Get External Data | Link Tables, i don't see my queries. is this possible??? and if so how?
sam
View 1 Replies
View Related
Feb 3, 2005
i have a button that open another form. the form should copy some filed from the form that the button in it.
Example. i have the from-A with field name- ID. in this form there is a button that open form-B.
this form had also the field ID and another fields of information on the specific person (with the same person form the form_A)
i want that the ID will automaticlly updated whrn i open the form so i can add another information. these are teo tables that are linked together and that is the reason that witohut the ID it cant be updated, and i dont want to update it manually.
View 6 Replies
View Related