When i open my db in 2003 I get a compile error: “can’t find project or library
i'm working in 07
please help!!
Here is the function
Code:Option Compare DatabaseOption ExplicitPublic Function HoursAndMinutes(interval As Variant) As String'************************************************* **********************' Function HoursAndMinutes(interval As Variant) As String' Returns time interval formatted as a hours:minutes string'************************************************* **********************Dim totalminutes As Long, totalseconds As LongDim hours As Long, minutes As Long, seconds As LongIf IsNull(interval) = True Then Exit Functionhours = Int(CSng(interval * 24))totalminutes = Int(CSng(interval * 1440)) ' 1440 = 24 hrs * 60 minsminutes = totalminutes Mod 60totalseconds = Int(CSng(interval * 86400)) ' 86400 = 1440 * 60 secsseconds = totalseconds Mod 60If seconds > 30 Then minutes = minutes + 1 ' round up the minutes andIf minutes > 59 Then hours = hours + 1: minutes = 0 ' adjust hoursHoursAndMinutes = hours & ":" & Format(minutes, "00")End FunctionPublic Function ElapsedTimeString(dateTimeStart As Date, dateTimeEnd As Date) As String'************************************************* ********************' Function ElapsedTimeString(dateTimeStart As Date, dateTimeEnd As Date) As String' Returns the time elapsed between a starting Date/Time and an ending' Date/Time formatted as a string that looks like this:' "10 days, 20 hours, 30 minutes, 40 seconds".'************************************************* ********************Dim interval As Double, str As String, days As VariantDim hours As String, minutes As String, seconds As StringIf IsNull(dateTimeStart) = True Or _ IsNull(dateTimeEnd) = True Then Exit Functioninterval = dateTimeEnd - dateTimeStartdays = Fix(CSng(interval))hours = Format(interval, "h")minutes = Format(interval, "n")seconds = Format(interval, "s")' Days part of the stringstr = IIf(days = 0, "", _ IIf(days = 1, days & " Day", days & " Days"))str = str & IIf(days = 0, "", _ IIf(hours & minutes & seconds <> "000", ", ", " "))' Hours part of the stringstr = str & IIf(hours = "0", "", _ IIf(hours = "1", hours & " Hour", hours & " Hours"))str = str & IIf(hours = "0", "", _ IIf(minutes & seconds <> "00", ", ", " "))' Minutes part of the stringstr = str & IIf(minutes = "0", "", _ IIf(minutes = "1", minutes & " Minute", minutes & " Minutes"))str = str & IIf(minutes = "0", "", IIf(seconds <> "0", ", ", " "))' Seconds part of the stringstr = str & IIf(seconds = "0", "", _ IIf(seconds = "1", seconds & " Second", seconds & " Seconds"))ElapsedTimeString = IIf(str = "", "0", str)End FunctionPublic Function ElapsedDays(dateTimeStart As Date, dateTimeEnd As Date) As String'************************************************* ********************' Function ElapsedDays(dateTimeStart As Date, dateTimeEnd As Date) As String' Returns the time elapsed in days between a starting Date/Time and' an ending Date/Time formatted as a string that looks like this:' "10 days" or "1 day".'************************************************* ********************Dim interval As Double, days As VariantIf IsNull(dateTimeStart) = True Or _ IsNull(dateTimeEnd) = True Then Exit Functioninterval = dateTimeEnd - dateTimeStartdays = Fix(CSng(interval))ElapsedDays = IIf(days = 1, days & " Day", days & " Days")End Function
When I'm trying to open a back end database which was previously created is MS Access 97 it gives me the following error;
Cannot update. Database or object is read-only.
I have tried running the "Compact/Repair Function of MS Access 97 and MS Access 2003 to no avail.
I have tried converting the back-end to Access 2003 as well but I still get the same error message. I can link to the database tables from an Access 2003 database fine with no error message!!
Has anyone got any suggestions before I have to take it offline and rebuild the back-end and then copy the data across from the old one?!!!
I have a subform which opens good with Access 2003 but now that I updated to Access 2007, it won't open. It gives me a "type mismatch in expression" error. Why does this happen??
I have a button that opens another form to enter data on. But when I click the button I am getting the error msg: "Can't find project or library." And the debugger goes to the following sub routine and highlights Date in 3rd line(tried to bold).
This only happens on 1 user's machine. The other 4 computers open it flawlessly. All 5 have the same setup/security. Don't know why it works on 4 and not the last one. Any ideas?
(Access97.) Private Sub Form_Open(Cancel As Integer) Dim x As Long Me.txtEntryDate.Value = Date Me.lblErrMsg.Caption = ""
Set rsVASRate = PTdb.OpenRecordset("SELECT * FROM tblVASRateCodes", dbOpenDynaset) x = 0 Do Until rsVASRate.EOF VASRate(x).RateCode = rsVASRate(0) VASRate(x).UnitFactor = rsVASRate("UnitValue") VASRate(x).CartonFactor = rsVASRate("CartonValue") x = x + 1 rsVASRate.MoveNext Loop
VASRateTableCount = x - 1
rsVASRate.Close
DoCmd.RunSQL ("DELETE * FROM tblVASData") 'clear VAS data summary table
If TableExists("tblVASEntry") Then DoCmd.RunSQL ("DELETE * FROM tblVASEntry") 'clear VAS data entry table Me.subform_VASEntry.Requery Else DoCmd.RunSQL ("CREATE TABLE tblVASEntry (VEID IDENTITY PRIMARY, 'Rate Code' INTEGER, Units INTEGER, Cartons INTEGER);") End If
My repair form pulls data from the vendor table to display the vendor information. Whenever i try to open the repair form, it gives me a popup first that says "enter the extention number" regardless of entering data or pressing cancel my form gets displayed.
When i enter a number (a random number) it wil populate my extention field along with all other data. And when i dont enter any number and hit the cancel button, it populates all data except the extention field, that has nothing to do with the number that i enter but is the one stored in the vendor table.
I am confused what to do with this Can anyone help me
I have created a database then saved it to my computer. Now while I am trying to open MS ACCESS in my computer I am getting an error message -
"This file may not be safe if it contains that was intended to harm your computer. Do you want to open this file or cancel the operation?" Giving the options - 'CANCEL' 'OPEN' 'MORE INFO'
I want to create a report using the data currently held in a form. I found this bit of code somewhere: DoCmd.OpenReport "report", acViewPreview, , "[job number] = " & txtFilter.Value
txtFilter is the name of textbox containing the data I want for the report. This works if in the table for txtFilter's data the field is set to a number. But if I set this field to text it comes up with a data type mismatch error. How do I solve this? (sorry new to access and vba). The reason I want to set it as a text field is so that I can limit the number of characters entered.
I just recently helped a local business move their files to a new server, and reinstall fresh windows and office on all their machines. I have run into a problem with Access, hoping someone can help.
Sometimes (usually when someone else has the file open), if you double click on the mdb file (which is on a mapped drive) nothing happens. If you make a shortcut that doesnt help. But if you open Access, and then goto File-Open and located the MDB file that way, it opens fine.
This is annoying to the employees and they want a solution.
A receive a compile error when an OpenForm macro action is executed. The error message is: The form you referenced may be closed or may not exist in the database. Microsoft Access may have encountered a compile error in a Visual Basic module for the form.
In the database that I use at work sometimes when we OPEN it we get an immediate error saying out of memory, therefore we close it and reopen and all is good.
This is a problem when the average user logs on as they don't close it, they just continue on and then start experiencing issues.
I thought that the memory was supposed to clear when you close the database.
We run the debugger and no errors are ever found, we also run the compact and repair.
This can happen 1 in 10 or maybe 20 times when we open the database.
when i want to open the database in an access database i have the following error. you have as the event property setting the expression entered when open.This expression has caused an error amppu (database name) can not find the form that is referred to
The code behind the report - sets on open_report event is the following however i cant see any issues with it as i use it elsewhere..
Code: ' Create underlying recordset for report using criteria entered in Dim intX As Integer Dim qdf As QueryDef Dim frm As Form ' Set database variable to current database. Set dbsReport = CurrentDb
[code]....
I will also attach a copy of how i set the criteria in the query and the parameters
When I open a query whether by double click or command button, the following error appears
What does it mean ?? this error appears sometimes not always. I can't figure out what this error refers to, as long as there no any error description or code.
I have designed a DB in access 2010 and it opens fine on my computer. However, when others I work with (who still have 2003) try to open the database, they get the following error: "An Error Has Occured Trying to Load The Form "Form Name" - Do You Wish to Continue".
When I click Yes, it brings up all of the VBA code in the background, but when i close all of that out, it still doensn't open.I am by no means an access expert.
Using an Access 2003 format database, opening in Access 2007...When I try to open my database I get two errors and it will not open.ID is not an index in this table.ParentId is not an index in this table.
I get the error when it opens with autoexec and when I bypass autoexec. I have a master copy of the database that I tried to link to the first database to import tables but I still get the error.
I have made a database, splitted it and then made the front end as accde. After that I copied both Front end & back end files in a shared folder. It is working fine as long as I am using it from my computer, but when I go to the other computer and try to open the front end, it gives the message of Unrecognized format error. This problem is only with the accde file, all other files are opening except this.
When I launch my Database file, it would normally run some scripts (I don't actually know what they do, the file is not used by me, only colleagues).
Instead i get this error:
The expression On Load you entered as the event property setting produced the following error: Object or class does not support the set of events.
When I click 'OK' another error appears:
The expression On Timer you entered as the even property setting produced the following error: Object or class does not support the set of events.
Once i click 'OK' on this error, another error sometimes occurs:
The expression MouseMove you entered as the even property setting produced the following error: Object or class does not support the set of events.
But strangely enough the third error doesn't occur every time i move the mouse.
After these errors have been closed, all i have is my 'form' with a loading bar. I cant access the actual database. Nor can i get into the Visual Basic to try and find the cause. This is happening to multiple clients of mine, and me personally.
Running Windows 7, Server 2008 (64bit), Windows 7 (64bit) Running Access 2007 and Access 2010.
I have tried changing permissions on the file, this doesn't work.
Here's my Goal: To open a saved query that has a parameter, setting that parameter via a VBA sub.
Here's my Problem: I was getting various errors, but after debugging my program a bit, it comes down to a "Data Type Conversion Error"
Here's my Code:
Set db = CurrentDb Set qd = db.QueryDefs("qryMY_DATA") qd.Parameters(0) = Me.txt_ReferenceID Set rs = qd.OpenRecordset("qryMY_DATA", dbDynaset)
Code: '*** Database Variables Dim db As DAO.Database, rs As DAO.Recordset, gq As DAO.QueryDef, prm As DAO.Recordset
I've been all over the forums and tried several different approaches, all to no avail. The Query runs fine in the QDT, but kicks back an error when I try to run it from my sub.
I have a form that contains a subform. The subform is a datasheet which calls the results of a query of 4 tables (tbl_companies, tbl_deals, tbl_products, tbl_vl).
In the main form there is a button which opens a report with a historical record of dates of value changes of each product up to a chosen date. This chosen date is determined by inputting a date into a text box.
This report also sources (tbl_companies, tbl_deals, tbl_products, tbl_vl).
When I try to open the report, I get the run-time error "3211".
'The database engine could not lock the table "Tbl_companies" because its already in use by another person or process.'
I'm guessing that because the query for the subform is already calling the table, the query for the report can't call the table at the same time?
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.
Private Sub Cover_Page_Form_Load() OpenTimer = Timer End Sub Private Sub Cover_Page_Form_Timer() If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.
I am very close to completing a DB Program.... How can I create a desktop Icon that will Launch my Program without Loading Microsoft Access along with it???
Im new to asp and access and have been having this problem for serveral weeks.
Every couple of days, all the asp pages on my site that communicate with the database start having 500 internal errors. i turned off the "Show friendly error messages" and one page gave me this specific error:
Microsoft JET Database Engine error '80004005'
Unspecified error
/admin/submitlogin.asp, line 8
I have tried a million things and have no idea why this is happening. Im not sure what other information i should post in order to see the problem. Any help would be greatly appreciated. Thank you,