I am using Access 2010...I am suddenly getting the error 3048: Cannot open any more databases...The error occurs on the line of code: Set db = CurrentDb()
Code:
Private Sub SetInUseFalse(TelesalesId As Long)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("Select InUseBy from tblTelesales where Telesalesid = " & TelesalesId)
Run Some Code
[code]....
Why should I suddenly get this error? The error appears to be in a loop. If I close the error message, it pops up again. I have to close the database using Windows Task Manager.Is there a maximum number of connections? But I religiously close connections as indicated above!.I am only connecting to the current database (backend form frontend)Am I opening / closing connections & recordsets correctly?
I am using an Access 2007 front end linked to an Access 2007 back end. I have a Report that the user operates by selecting the information he/she wants to see on a pop-up form and clicking a button. The Report works perfectly unless another form, called Shows Form, in the database is opened. When Shows Form is open the Report/button on the pop up form generates Error 3048: Cannot Open Any More Databases. Also when Shows Form in open, the Query that the Report calls on also won't run. The Query gives gives the same error - Cannot Open Any More Databases.
I have been through my code with a fine tooth comb to make sure all DAO.Recordsets and DAO.Databases are closed after they are used. The troublemaker Shows Form is quite complex and has many sub-forms (11), on a tab control (9 tabs). The Shows Form is the work horse of the database and the User needs to have this form open all of the time. It is inconvenient to have to close the Shows Form in order to use the Report. I am suspecting, through my internet reading, that the multiple sub-forms in the Show Form are using up resources and causing Error 3048.
I thought maybe I could look at coding the sub-forms to open only when needed - when the user clicks on the tab containing the sub-form. Would that conserve resources?
I have a db that runs call stats (Master) this exports to several Department (Slave) Databses. The Slave db's can be accessed by any of number of Managers.
My problems (Amongst others!) is that I run the master every 15 mins and the slaves are linked to the master tables. How can I set this up so that these slaves can be updated whilst they are logged into?
I'm having a problem on a workstation that I've always used to create databases in Access. When I open any of my saved .mdb's I get a the error "end query expression" with the table name. The message gives me the option to click OK or Help and Help refers to "<Message> in query expression <expression>. (Error 3075)".
I've copied the .mdb's to another PC with Access installed and they open with no problem and I've removed and reinstalled Access on the problematic PC but still the same problem.
Also, I have a UPS Worldship shipping application that uses an Access database and when it opens it gives me a Micrsoft Visual C++ runtime error then closes, which may or may not be related.
I get the sense that something is corrupted in either Access or Windows XP but I'm not sure where else to look.
This is the second database where this has happened to me. I have code to print a report (with several sub-reports) to PDF. When it prints, only the first couple reports appear. The rest of the pages on the PDF are blank. If I try manually saving to PDF (Save As > PDF or XPS), I get the error "Cannot open any more databases."
In the other case, my "solution" was to copy all the queries into temporary tables and use the temp tables as the datasources for the reports.
Any way to list all currently opened Access databases? It feels like this must be possible by referring to the databases collection, but I just don't know how.
Also, is it possible to refer to controls on a form in one open database from code in another database? (and obviously if so, how?)
I'm scanning bar codes into the record search box, most of the time it works as it should but occasionally I get multiple "cannot open any more databases" errors. It still finds the product record but the error messages are super annoying. I am sure to clear the memory on the scanner each time before I scan in a new barcode but it doesn't seem to matter. Also sure to only have one or 2 forms open at a time, that doesn't seem to matter either. Most of the time I don't get the errors but when I have to click through like 10+ error messages (all identical). I only have one database open so I'm not sure what it even means. Also I have tried this in 2 different forms and it's the same for both forms. Seems like I get the errors in my initial scan and then after clearing them it seems to work without errors.
I have one Master database and multiple child databases in a folder. Each of these databases (both Parent and Child) have identical table called "source". I need a VBA code which will consolidate tables of child database into the Parent database table.
I have 192 databases that I need to redact certain information in certain columns. Generally, I'm looking for field names like name, first name, last name, address, address2, shipping address, mailing address, and phone numbers. Not sure how to get this information without going into every database and every local table inside the databases. Is there a way to get this information programmatically and just access the databases and table that I need to redact info in?
I have database for each location. Every location will update some information in the databases and send it back to me. In those location based databases, information will be stored in one table called "consolidate_input". I will store these databases in one specific directory and then I want to accommodate the data of "consolidate_input" into one master database having the same identical table in the database.
I want to find out how I can write VBA to find out if a default browser is open to a particular webpage. I guess I'm going to have to find the browsers handle but I also don't know where to go from there.
The code below opens a PDF selected from a form. Whatever document number appears in the textbox (FICNo) on the form is the document that is opened when the command button is clicked.It works but I would like to add a message box to say File not found if the document number in the textbox has no corresponding document in the folder (ScannedFiles).
Code:
Option Explicit Option Compare Database Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL As Long = 1 Private Const SW_SHOWMAXIMIZED As Long = 3 Private Sub CmdOpenDoc_Click() ShellExecute 0, "Open", "C:UsersDavid.BallDesktopScannedFiles" & Me.FICNo & ".pdf", vbNullString, "C:", SW_SHOWNORMAL End Sub
I have a list box which contains different types of log entries. Each different log entry type has a different report that goes with it.What I want to do is select an entry in the list box, and click on print, email, pdf or view report buttons, and the appropriate happens, selecting the associated report for the log type automatically.I have a table with the logtype in it, and against that I have a DefaultReport field, which contains the name of the report that needs to be opened for that logtype.
I am getting the correct name for the report no problem at all, I have made sure that the name is right by going to rename report and copy and pasting it.When it goes to open the report I get an error message - Run-Time error 3071, the expression is typed incorrectly or is to complex to be evaluated.I have a debug line running to make sure I am pulling back the correct report name and I am.I have tried putting the dlookup where the report name would normally go in the docmd.openreport and I have also tried using ReportToView as a String and putting that in the docmd.openreport, but to no joy.
I have tried it with and without " around the report name and still no joy, either in the table or by concatenating the dlookup with Chr(34) at either end of it, then it comes up saying the report cannot be found.
I am trying to open a database with a password (I know the password) from another database however I cannot work out how to do it. I have been using this code to do this to open databases without passwords for a while.
I am using Access 2007.
Code: Private Sub Command36_Click() Const cstrClientFEPath = "G:Templates" Const cstrFEFile = "db.accdb" Dim intX As Integer 'Utility var
I am using the following event code to open a database from another. Everything works fine but, I would like add a mxgbox letting the user know the database does not exists and to contact me for assistance.
Private Sub cmdOpenTime_Click() Dim accapp As Access.Application Set accapp = New Access.Application accapp.OpenCurrentDatabase ("c:PILOT_ApplicationTIME.Accdb") accapp.Visible = True End Sub
In my frontend code, I include a table with a version #. In my backend, I also include a version table. The front end will compare wih back end, and if it's different, it will force to get the updated version that it's stored in the LAN.
However, I do not want the user to open the file directly from the LAN because it might cause slow performance problem if multi-user,etc.
So I want to implement a code to force the application to be open only from desktop.
So far, I have a strUsername which detect the user network environ. Then, it will check the application path to determine if it was opened from:
C:Users<strUsername>Desktop
If not, then an error message will prompt to alert the member to copy the file in the LAN and save on their desktop.
It works on my laptop, all fine. Today I didnthe test in my user desktop, but the message saying that the file has to be opened from desktop keep appearing.
I double check the user folder and the Username environ is (cd98) but the user folder was setup as "CD98" capital letter. Does that affect the coding?
How can I make my code to not distinguish between lower or upper case either for username and folder user as well?
I want a user to enter a number into an input box and then based on the number in this box a form will be opened with records associated only with that employee number. (All employee numbers are stored as text)The code below opens the form, but it is blank.
Private Sub cmdOpenAddKeys_Click() Dim EmployeeNumber As String EmployeeNumber = InputBox("Please Enter Employee Number:") DoCmd.OpenForm "frmAddKeys", acNormal, , "[Forms]![frmAddKeys]![empno]=" & EmployeeNumber End Sub
I have a query that opens a listbox in a form. In the listbox I want to add a doubleclick event that opens a pdf document with the selected record in it. The record is in column 1 of the listbox.
I can't use the FollowHyperlink method of the colecction application due the record in the column is a Key. I am not sure if FollowHyperlink method can be used in a listbox
I have been checking codes in the web and I found this:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long ShellExecute Me.hwnd, "open", "D:SebDesktopGA-BDpdf est.pdf, "", "", 4"
However, I don't know how to organize the code in a logic way in Sub End Sub. Neither I don't know if the code is for the doubleclic event in the list box or a Module. If is for a module I don't know how to write the code in it.
I have a workbook which is already opened and I want to close it. the code that i have is (see below) is not working.
Code:
Function CloseExcel(sExcelFile As String) As Integer Dim XLapp As New Excel.Application Dim ObjXL As Excel.Workbook On Error GoTo ErrorTrap Set ObjXL = XLapp.Workbooks.Open(sExcelFile)
I have a Database with a field that holds several attachments. I want to make a command button for a form that will open the attachment window that pops up when you double click on the attachment in the table. attach_fig7(1).gif.. I'd like the above window to open when I click the command button.
I'm having a little trouble getting this accomplished. I can instruct access to print the report, however I just want to be able to view the report after I select a button. I will attach a picture so you can see what I have thus far. I do have an older version of this and it works flawlessly and as far as I can tell everything is a carbon copy of the working version.
I want to open the dropdown box on my datasheet view subform from the main datasheet view form when I run over it with the mouse.From my main form textbox [WelderID]I tried this code but doesn't work. I get the error invalid reference to the property Form/Report.
Private Sub WelderID_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single) Forms![Main]![WorkOrder Form]![DrawingNo fm]![Welds fm]![WelderStamp Sfm]![WelderStamp].SetFocus Forms![Main]![WorkOrder Form]![DrawingNo fm]![Welds fm]![WelderStamp Sfm]![WelderStamp].Dropdown End Sub
I am not sure if there is more code to use to open the subform in the datasheet view.
I have a list box that displays records. When i double click a record it opens the form needed.However I want it to open the form but default to a specific tab. But when it goes to the tab, the subform within it needs to match the ContractID of the record they double clicked on in the search form?I currently have this which opens the Client Form based on the ClientID of the listbox query search results and the client id of the main record.
Code: Private Sub SearchResults_DblClick(Cancel As Integer) If CurrentProject.AllForms("frm_Clients").IsLoaded Then DoCmd.Close acForm, "frm_Clients" End If DoCmd.OpenForm "frm_Clients", acNormal, , "[ClientID] = " & Me.SearchResults.Column(0)
So in theory If doubleClick then open Client Form on Tab3 where subform Contract field ContractID is matches the ContractID in on the search results?