My db works well, it has been compressed/repaired & the code complied without any problems until I convert it to an Mde :confused:
The problem I have is that for some reason three of my sub forms will not function properly without getting this on click warning
The expression on Click you entered as the event property setting produced the following error:The expression you entered refers to an object that is closed or doesn't exist.
Visual Basic for Applications (VBA) encountered a problem while attempting to access a property or method. The problem may be one of the following: A reference is missing. For help restoring missing references, see the Microsoft Knowledge Base article 283806. An Expression is misspelled. Check all expressions used in event properties for correct spelling. A user-defined function is declared as a sub or as a private function in a module. Expressions can resolve a user-defined function only if the function is declared as one of the following: - A public function in a module - A public or private function in a code module of the current form or report Security in Access is set to Medium or High and the Microsoft Jet 4.0 SP8 update is not installed. A more recent verion of Jet 4.0 must be installed for Access to function properly when security is set to Medium or High. To obtain the latest version of Microsoft Jet, go to Windows Update.
I don't understand why there is a problem if it works fine without converting it to a Mde.
The 3 subforms do have one thing in common though
they have a cmd button that moves the focus to another object on the form & then the subforms visibility is set to false.
[Private Sub CmdClose_Click()
On Error GoTo 0 'Err_cmdClose_Click If DCount("*", "tblTaskScheduleRates", "[SRLINKTask] = " & Me.Parent.TaskID) = 0 Then Me.Parent.frmFlashRates.Visible = True Me.Parent.cmdViewRates.Visible = True
If DCount("*", "qrySubbyFlash", "[TaskID] = " & Me.Parent!TaskID) > 0 Then Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1) Else Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(0) End If
If DCount("*", "qryOperativeFlash", "[TTLINKTask] = " & Me.Parent!TaskID) > 0 Then Me.Parent!cboTaskStatus = Me.Parent!cboTaskStatus.ItemData(1) End If
End Sub
Private Sub cmdSave_Click()
If DCount("*", "tblTaskMessage", "[TMLINKTask] = " & Me.Parent.TaskID) = 0 Then Me.Parent.frmFlashMessage.Visible = True Me.Parent.cmdViewMessages.Visible = True End If Me.Parent.cmdNotes.SetFocus Me.Parent.frmTaskMessageSubForm.Visible = False Me.Parent.frmTaskMessageViewSubForm!lstMessages.Re query Me.Parent!lstRevisedCost.Visible = True
End Sub
it works just fine as a normal database but for some reason it causes problems as an Mde.
I basically want an SQL statement that will search all fields of a table for a certain value. At first I thought that tihs might work.. Code:SELECT * FROM tblExample WHERE *='blah';
But it doesnt :-/
So, is there any other method of doing this? I know that I could just include each individual field name, but Im lazy - and its a big table (plus I want to use a similar query on a few other tables, so I want it to be fairly generic).
Not sure how to work in the '* ROLL *' into this SQL statement. The query statement works fine ... I have tried different quotation methods ( Not Like " & " ' * ROLL * & ' " & " ) AND .... )
sql = "SELECT DISTINCTROW Sum(CDbl([Scrap Factor])) AS SumOFScrap FROM [RT: Signpro1: Costs] LEFT JOIN [DT: InventoryExtend] ON [RT: Signpro1: Costs].[Part Number] = [DT: InventoryExtend].[Part#] GROUP BY [DT: InventoryExtend].CategoryID, [DT: InventoryExtend].Description, [forms]![signpro sign estima parameters]![combo14] HAVING ((([DT: InventoryExtend].CategoryID)=30) AND (([DT: InventoryExtend].Description) Not Like '* ROLL *') AND (([forms]![signpro sign estima parameters]![combo14])=1));"
Ive created a database using the file system object that creates folders, moves files from one folder to another, etc.
This works perfectly on my home pc, but when i try to install it on the server at work I get the following error message:-
Runtime Error 429
Active X component can't create object
I've had a look on the net and appears that it only happens on certain computers and I wondered if anyone had any quick fixes that they had come across over the years.
I have this error when on: DoCmd.GoToRecord acDataForm, "PaycheckTable", acNewRec Whent I trace with the debugger when the ENTER keyy is pressed event.
If I don't use the debugger I don't see any error. This problem occurs when I check a specific checkbox and trying to go to a new record (Whith the other checkboxes I don't have a problem).
Another symotom: When I use the next or new record buttons I don't have any problem.
Using Access 2003 and Word 2003 on a WinXp Workstation with all SPs and updates.
The code that I'm using is MS standard (see below) and has never previously given me any problems albeit using Access 2000 and Word 2000.
I've searched the MS knowledge base and googled the error but nothing I find seems to relevant to this situation.
It falls over on the '.Destination = wdSendToNewDocument' line.
Can someone help?
TIA,
Mo
--------Code----------
DoCmd.Hourglass True
If CreateWordObj() Then With gobjWord .Visible = True .Documents.Open "d:screening emplate.doc" DoEvents With gobjWord.ActiveDocument.MailMerge .Destination = wdSendToNewDocument .SuppressBlankLines = True .Execute End With '.ActiveDocument.PrintPreview .Visible = True End With End If
I created a database for someone at work, with the main point of it being for someone to enter a date in one field, and then 13 weeks from that date, it ticks a box, and then 26 weeks from the date inputted, it ticks another box.
Now, all was working fine, but today she came to me and showed me an error that keeps appearing.
What happens is when she creates a new record on the form, if she doesn't input either a date (so the above formula can work), or the persons name in the appropriate field, a Runtime Error 94 appears, which I think says 'Invalid Use of Null', or something along them lines.
I've looked at the coding, and am a bit stuck (bare in mind I don't know a great deal about coding).
From memory, in the coding, the database looks at the date inputted, then adds 13 or 23 weeks to the date, and ticks when it gets to that point. However, if this date isn't inputted, that is when the run time error appears. I have no idea at all why this happens when the name isn't inputted.
If it's any help at all, the bit that is highlighted in yellow in VB, when I click debug, is as follows:
dStart = Me.txtStartDate
Underneath this it has the formula that adds 13 weeks to that date, and then the same but for 26 weeks.
I'm guessing I need to tell it that when there is nothing inputted in the date field, it doesn't have to do the formula. It doesn't like having nothing in the date field.
Apologies if that makes no sense.
If anyone at all can help, it would be much appreciated.
I have been writing databases for several years now, so I know my way around access pretty good. I have come upon a strange error though. which is confusing me to now end. I wrote a Database on my work machine which has the latest version of MS Access and SP2 for Office. I just tried to send it to another employee for them to test. Now they do not have the full version of MS Access installed on their machine, they only have the runtime version which only runs the Database. The load works fine and the first screen uses ADO to lookup some value and display them in a list box, nothing crazy, everything works fine. Now using this form, when they click a button the info in the list box is used to set the Fields a new Unbound form. And this is where the error happens. The on_load event of the form fails for some reason, and gives a msgbox which says, "Runtime error occured and the App needs to close", but the prog works fine on my machine. I am baffled. The file is a MS Access 2000 format, I tried changing it to MS Access 2002/2003 Format, and when I do that they cannot open the file because it says they do not have thje latest MS Access version. I have no idea what, why the error occurs, any ideas??
Why does the following code generate an error. All i want to do is open a recordset which I thought would be straightforward. (novice Programmer, new to access vba). The set statement in the ComboProduct event generates the error.
Option Compare Database Dim Company As String Private dbaProposal As DAO.Database Dim EffectiveDate As Date Dim Product As String Private rstProposal As DAO.Recordset
Private Sub ComboProduct_AfterUpdate() Product = ComboProduct.Value Set rstProposal = dbsProposal.OpenRecordset("SELECT * FROM Proposals WHERE Proposals.[Group Name]='" & Company & "' AND Proposals.[Effective Date]=#" & EffectiveDate & "# AND Proposals.Product='" & Product & "'") End Sub
Private Sub Form_Load() Set dbsProposal = DBEngine.OpenDatabase("Database1.accdb") End Sub
That error keeps on appearing in my application and no way to sort it out...
The error is the following: Runtime error 3734: the database has been placed in state by user 'Admin' on machine ... that prevents it from being opened or blocked.
I tried to sort it out by doing:
set db= opendatabase(database,0)
but still appearing the message.
could i solve it by checking if there is an actual opened connection before starting a new one? and in case that that there is an opened one, close that.
Hello Access friends, What is wrong with the following code (modified the module from http://members.iinet.net.au/~allenbrowne/AppInventory.html ): I Keep getting a runtime error 3061 Too few parameters . Expected 1 on the line highlight below. I have the reference MS DAO 3.6 selected and I am using access 2000 and calling the module from a command button in a form. Thanks in advance for taking the time to help me out.
Dim db As DAO.Database 'CurrentDb() Dim rs As DAO.Recordset 'Various recordsets. Dim strProduct As String 'vProductID as a string. Dim strAsOf As String 'vAsOfDate as a string. Dim strSTDateLast As String 'Last Stock Take Date as a string. Dim strDateClause As String 'Date clause to use in SQL statement. Dim strSQL As String 'SQL statement. Dim lngQtyLast As Long 'Quantity at last transaction. Dim lngQtyAcq As Long 'Quantity acquired since incoming transaction. Dim lngQtyUsed As Long 'Quantity used since outgoing transaction.
If Not IsNull(vProductID) Then 'Initialize: Validate and convert parameters. Set db = CurrentDb() strProduct = vProductID If IsDate(vAsOfDate) Then strAsOf = "#" & Format$(vAsOfDate, "mm/dd/yyyy") & "#" End If
'Get the last transaction date and quantity for this product. If Len(strAsOf) > 0 Then strDateClause = " AND ([TransacDate] <= " & strAsOf & ")" End If strSQL = "SELECT TOP 1 [TransacDate], [Quantity] FROM [Transactions] " & _ "WHERE ((ProductID = " & strProduct & ")" & strDateClause & _ ") ORDER BY TransacDate DESC;"
Set rs = db.OpenRecordset(strSQL) With rs If .RecordCount > 0 Then strSTDateLast = "#" & Format$(![TransacDate], "mm/dd/yyyy") & "#" lngQtyLast = Nz(!Quantity, 0) End If End With rs.Close
'Build the Date clause If Len(strSTDateLast) > 0 Then If Len(strAsOf) > 0 Then strDateClause = " Between " & strSTDateLast & " And " & strAsOf Else strDateClause = " >= " & strSTDateLast End If Else If Len(strAsOf) > 0 Then strDateClause = " <= " & strAsOf Else strDateClause = vbNullString End If End If
'Get the quantity acquired since then. strSQL = "SELECT Sum([Transactions].[Quantity]) AS QuantityAcq " & _ "FROM [Transactions]" & _ "WHERE (([Transactions].[ProductID] = " & strProduct & ") AND ([Transactions].[TransacType] = 'Incoming')" If Len(strDateClause) = 0 Then strSQL = strSQL & ");" Else strSQL = strSQL & " AND ([Transactions].[TransacDate] " & strDateClause & "));" End If
Set rs = db.OpenRecordset(strSQL) If rs.RecordCount > 0 Then lngQtyAcq = Nz(rs!QuantityAcq, 0) End If rs.Close
'Get the quantity used since then. strSQL = "SELECT Sum([Transactions].[Quantity]) AS QuantityUsed " & _ "FROM [Transactions]" & _ "WHERE (([Transactions].[ProductID] = " & strProduct & ") AND ([Transactions].[TransacType] = 'Outgoing')" If Len(strDateClause) = 0 Then strSQL = strSQL & ");" Else strSQL = strSQL & " AND ([Transactions].[TransacDate] " & strDateClause & "));" End If
Set rs = db.OpenRecordset(strSQL) If rs.RecordCount > 0 Then lngQtyUsed = Nz(rs!QuantityUsed, 0) End If rs.Close
'Assign the return value OnHand = lngQtyLast + lngQtyAcq - lngQtyUsed End If
Set rs = Nothing Set db = Nothing Exit Function End Function
Hai I am arif.I am a vb programmer.I try to open the recordset but one error coming that is methot 'open' of 'object_recordset' failed.
Private sub cmdcheck_click() dim rscom as adodb.recordset s1="select * from class_subj where class='"& trim(lstclass) & "' and section= '"& trim(lstsection) & "'" set rscom=new adodb.recordset rscom.cursorlocation=aduseclient rscom.open s1,con,adopendynamic,adlockoptimistic rscom.close set rscom= Nothing End sub
I have an 'add new order' form which opens with all the fields blank and focus set to a combo box. The first thing the user must do is select a contract name or number from an unbound combo box. I then want the form to update and show all the relevant information in the form fields.
In the row source of the combo box I select all 3 fields from the same table (Project_Info). Only the contract number is visible all others are set to 0cm width in combo box properties.
In the afterupdate event I have the following code to set the field to the values from the select query
My code looks like this: [code] Private Sub ProjectContractNum_AfterUpdate() Dim sOrder_idSource As String Dim rs As Object ProjectName = ProjectContractNum.Column(1) proj_status = ProjectContractNum.Column(2)
End Sub [end code]
My SQL in rowSource looks like this: SELECT Project_Info.proj_name, Project_Info.proj_contract_no, Project_Info.proj_status FROM Project_Info;
Access tells me that I don't have a join key in my record set. message reads as follows:- Run-time error '2147352567 (80020009)': Cannot add record(s);Join key of table Project_Info' not in record set.
Debug highlights this line: proj_status = ProjectContractNum.Column(2)
'proj_status' is the name of the text box and the control source.
If I just use just the first 2 fields (project number and project name) these two work!!
I have a form that contains a field with an On Click event procedure to send the value in that field to a corresponding field on a subform attached to another form. Does that make any sense? The On Click procedure looks like this:
I’m not quite sure what I am doing wrong. I am getting the Run-time Error ‘2465’ and it is pointing out that it is unable to find field ‘fsubSubFormName’. I have double (and triple) checked the names and I have not misspelled the names of the form or subform. Did I set up the event incorrectly? Could it be that I am not calling the subform the correct way? Any ideas? .....
I get a runtime error that says "No value given for one or more required parameters" and I can't figure out what is wrong with the statement that it is referring to:
.Source = "select timage.*, InStr([Keywords],'" & [Forms]![search options]![searchtext] & "') AS Expr1, IIf(IsNull([forms]![search options]![combo121]),[category],[category]=[forms]![search options]![combo121]) AS Expr2" _ & " FROM timage WHERE (((InStr([Keywords],'" & [Forms]![search options]![searchtext] & "'))>0) AND ((IIf(IsNull([forms]![search options]![combo121]),[category],[category]=[forms]![search options]![combo121]))=-1));"
I'm not sure if more information is needed, but I thought perhaps something might jump out to a more experienced Access person.....
I'm trying to delete a file in a network location. Sometimes the file is there, sometimes it's not, so I'm using the following code:
Code: strPath = "etwork driveMy Folder" strFilename = "MyFile.doc" If Not Dir(strPath & strFilename) = "" Then Kill strPath & strFilename
Occasionally, I get a runtime 52 error when the file doesn't exist. I don't understand why I'm getting this when, if the file doesn't exist, the Dir function should return "".I searched the forums for Runtime 52, and didn't find anything pertaining to this.
I have a subform embedded in a mainform which contains loan payment details over a number of months. The record starts with the payment period number ie 1,2,3 etc. The problem is that every now and again the subform changes the display order of the records so that I get 4,5,6,1,2,3.
When I look at the underlying table the order is OK as is the non embedded sub form. I cannot see any reason for the change and it only happens randomly (apparently).
The numbers are not autonumbering but manually input. Hope someone can help please.