Forum Discussion
RichNewman
Aug 02, 2022Copper Contributor
First addnew record slow
I am running an Access split database application using Office 365. I have a form that is not bound to a table -- the user fills in multiple fields on the form and then clicks an "Add Record" button...
RichNewman
Copper Contributor
Hi arnel_gp,
Sorry for the delayed response. I appreciate your help.
I'm having trouble getting this code to work. In the Replace$ statement, all I did was to swap the name of one linked table in my back end file, for the string "oneLinkedTableHere". I left the rest of that statement intact. So it now reads:
Replace$(myBe.TableDefs("tblActivity").Connect, ";DATABASE=", "")
When I run this, I get run-time error 3055 Not a valid file name. It's pointing to sBackEnd as faulty.
I changed your code just to test to the following:
Public Function OpenBE()
Dim sBackEnd As String
Static myBE As Dao.Database
Set myBE = CurrentDb
'retrieve the backend path and name
sBackEnd = "M:\Proposals Databases\Activity Tracker Data.accdb"
'open the BackEnd
Set myBE = DBEngine.OpenDatabase(sBackEnd, False, False, "MS Access;PWD=Password123")
End Function
In the OpenDatabase statement, I think I have to put in the password as you see above because that BE file is password protected.
Did I capture what you intended? My rewrite runs without error, but it didn't solve the problem. Maybe because of something I misinterpreted about your code?
Your help getting this right will be very much appreciated.
TIA
Sorry for the delayed response. I appreciate your help.
I'm having trouble getting this code to work. In the Replace$ statement, all I did was to swap the name of one linked table in my back end file, for the string "oneLinkedTableHere". I left the rest of that statement intact. So it now reads:
Replace$(myBe.TableDefs("tblActivity").Connect, ";DATABASE=", "")
When I run this, I get run-time error 3055 Not a valid file name. It's pointing to sBackEnd as faulty.
I changed your code just to test to the following:
Public Function OpenBE()
Dim sBackEnd As String
Static myBE As Dao.Database
Set myBE = CurrentDb
'retrieve the backend path and name
sBackEnd = "M:\Proposals Databases\Activity Tracker Data.accdb"
'open the BackEnd
Set myBE = DBEngine.OpenDatabase(sBackEnd, False, False, "MS Access;PWD=Password123")
End Function
In the OpenDatabase statement, I think I have to put in the password as you see above because that BE file is password protected.
Did I capture what you intended? My rewrite runs without error, but it didn't solve the problem. Maybe because of something I misinterpreted about your code?
Your help getting this right will be very much appreciated.
TIA
arnel_gp
Aug 05, 2022Steel Contributor
there is a better explanation here but i think you got it.
https://www.fmsinc.com/microsoftaccess/performance/linkeddatabase.html
https://www.fmsinc.com/microsoftaccess/performance/linkeddatabase.html