I'm working on a query that lists all the queries in an Access database, and I would like the query to show the object description which is displayed when you right-click an object and display the object's properties. For queries, this is a text box just below the query name in the properties window.
So far, all I have is:
Code:
SELECT ID, Name FROM mSysObjects;
I would like to have something like:
Code:
SELECT ID, Name, Description FROM mSysObjects;
I have list box of reports in a form and when selected i want to write the reports description propterty to a textbox.
I modified an example i found posted someplace (can't recall where) and it worked great - just like this (see below).
Then I put it into another database (exact same tables, form and and queries) and if there is a description in the query property it will always give me the error "Type mismatch".
Why? The only difference I can see is that the working example db had the following References selected: Visual Basic For Applications Microsoft Access 9.0 Object Library Microsoft DAO 3.6 Oject Library ... in that order.
My database where it is not working has selected: Visual Basic For Applications Microsoft Access 9.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library
Is there a better way to fetch this property? Or is there a setting I need to change - keeping in mind that changing these settings may cause the rest of my db to fail now...
Thanks A lot for any help you can give.
Function ReportDescription(ReportName As Variant) As String On Error GoTo Err_ReportDescription Dim db As Database Dim con As Container Dim doc As Document Dim prp As Property Set db = CurrentDb() Set con = db.Containers("Reports") Set doc = con.Documents(ReportName) Set prp = doc.Properties("description")
ReportDescription = prp.Value Exit_ReportDescription: Exit Function
Err_ReportDescription: If Err.Number = 3270 Then ReportDescription = "There is no description for this Report" Resume Exit_ReportDescription Else MsgBox Err.Description Resume Exit_ReportDescription End If End Function
Private Sub lstReports_Click() Me!txtReportDesc = ReportDescription("rpt" & Me!lstReports) 'Me!txtReportDesc = ReportDescription(Me!lstReports) End Sub
Through a set of circumstances, I have had to quickly migrate a long-standing (and business critical) database from Access 2003 to Access 2013, without the sort of prepping and planning that I would normally do in such circumstances.
Most functionality appears to be working ok...
Many of my database objects, especially queries, were given meaningful descriptions.
For example, a number of queries might have been described as "Accounts Data Validation".
When I wanted to run validation of the Accounts data, I would simply sort the database queries window by description, then scroll to the relevant section and run all of the tagged queries in turn.
However, having migrated to Access 2013, although the descriptions are still shown, I can no longer sort by them !
Medium term, I could probably assign different database objects to "Groups", but we are talking hundreds, perhaps even thousands of different objects and that would be a laborious and extremely tedious process.
Any way of sorting the database window by description in Access 2013 ?
I want to disable a button right after click it. Because I could not disable a control that has got the focus, i tried to shift the focus to another control; however, all controls that I tried to shift the focus to don't support the method (SetFocus = true).
I want to do this on a subform's control, but I keep getting this error: Object does not support this property or method.
I am cleaning up a database that has been around for some time and I wish to be able to check for references within REPORTS/VBA Module code/ Form Designs etc. anywhere there is likely to be a reference to either an Access TABLE or QUERY.... I know there is the 'Object Dependencies' function within Access that will go some way to telling you what relies on what, but this is simply not comprehensive enough in that it doesn't go down to Form design level where further references can hide...
Countless times I have checked and subsequently deleted tables that I considered redundant... only to find later on there was some SQL Source reference to a table or query buried in the design of a form that I had overlooked....
Any way to definitively check and to ensure that all traces of a specific table or query are accounted for...?
My combo boxes are not returning the actual combo box values back to my table, instead in the table it is displaying the combo box data list number i.e 1,2,3,1,5,1 etc where it should be displaying a property address.
I am using Access 2010. I have many tables that are downloaded from SAP into Access.
Within each table structure are the following standard Access attributes: Field Name Data Type Description
When I create a query I add the Field Name from the table nothing earth shattering here. But, in addition or instead of Field Name, I want to use the Description attribute. Mostly because the SAP field names are acromyms in German and are useless to the untrained eye. Please see attachment as an example.
Is there a way either using VBA or some special SQL language in any query I write to show me the Description instead of or in addition to the Field Name?
I'm trying to extract information from Err.Description within a form's Error event. Alas, Err.Description does not seem to be available from there.I have a form that normally displays in DataSheet view. If a trigger on the Oracle back-end raises an error, I want my Access app to be able to parse out Err.Description and deliver a more user-friendly message than ODBC's message. I want to get the info about the message from the error coming back from Oracle, not by matching up error codes.
If I change the form to Single-Form view and put a Save button on it, I can capture Err.Description in the command button's Clicked() event, and then parse out what I need.So if I must display this form in Datasheet view, where can I trap the ODBC error and display my user-friendly message?
My question is in Access 2010 I am currently in the property sheet at a combo list i just added to a form to be more precise with the data the user will look for. My question is I know I have to be in Control source in order for the combo box to select the data that I entered from the table. When i click the arrow the drop list is empty and then when I click the elipses (three dots) it takes me into expression builder, so i am confused on what I should do to select the field I want the combo box to focus on.
I'm relatively new to access. I probably use about one tenth of one percent of what it has to offer because I have trouble understanding it at this time. I need to know how to update a yes/no object.
Been using XP all this time, just got a new computer with Windows 7. Still using old Access 2000, not my call to update as this is the decision of the guy who owns the database.
Anyways, I opened Access for the first time, just a blank database so I can set up the user account. When I go to Tools > Security > User and Group Accounts and try to assign a password to Admin, I get the error message that it cannot update because the database is read only.
Where did this come from? I have never seen this message before, and the person who owns the database has a couple computers with Windows 7 that I have set this up on and did not run into this issue.
I realize that there can be some compatibility issues with Windows 7 and Access 2000 but it has worked on other Windows 7 computers, and not using the virtual XP mode.
I am using a command button to email an invoice to a customer using the sendobject function, whilst this almost works correctly it is adding an additional mailto:address along with the correct email address.
Example: CorrectEmailAddress and then#mailto:CorrectEmailAddress
The code I am using is:
On Error Resume Next Dim Cusemail As String Cusemail = Nz(DLookup("Email", "invoiceemailQ", "orderID=" & OrderID), "") If Cusemail = "" Then MsgBox "No email Address" Exit Sub
I have adopted someone elses database. It is a front end with about 100 linked tables/forms/reports/modules. The problem is that the database is really large. I would think by looking at the objects that it should be around 5mb tops, however after compacting it is still 63mb.
Is there a way (vba or otherwise) to look at each object and get its size in KB?
Once I can figure out which object is taking up too much space I can work on making them smaller.
Is it possible to declare a reference as an object, this way we could avoid our issues with broken references? I would just try it, but it seems like there is a quite a lot of testing it would require.
I have a form that is to be used to browse through parts using various filters (like category, snippets of part number or description) to find particular components, and then draw information from those components onto the form to be used for other things.
Queries I seem to understand - I've made a query which I've embedded on the form which happily filters the parts using the combo-boxes and text boxes on the form.
What I can't figure out is how to access the information IN the query! There doesn't seem to be a "double-click" event, or a "highlighted row" property, that I can use to tell the query WHICH of the parts returned after filtering is the particular one Im interested in, to draw information from the row.
What I want is a command button that, once the desired part is selected, "sucks" the data out of the query into text boxes on the form.
I've tried something like -
Private Sub cmdSelect_Click()
Me.txtSelectedPartID = Me.qryPartFinder.PartID
End Sub
...but it tells me that the method or data member is not found. When I'm typing the code the auto-complete thingy happily finds "qryPartFinder" when I type "me", but none of the available properties in the list for qryPartFinder seem to be what I need.
How DO you access the data in a highlighted (and/or somehow selected) row?
I and trying to link to Outlook 2007 using the "External Data/More/Outlook Folder option and keep getting the "Object Class does not Support the Set of Events" error message.
I can link to a DBF and Paradox file without any problems.
I am running Office 2007 Professional and Access 2007 and Windows 10.
I have also done the following:
1. Removed Office 365 2. Decompiled the Access VBA code and corrected any issues 3. Compacted/Repaired the database
I have attached a screen shot of the references that I have selected.
This is a new setup as I recently purchased a new PC and Windows environment. I still have the old PC running Windows XP with the same configuration and it also experiences exactly the same error message.
I have 2 tables and from them I do a query called "Query_Dates". There, I created 4 calculated fields which compares fields of the two tables previously mentioned.
What I am trying to do is everytime the calculated fields are equal to "Diff", gets the value from the second table (ADHOC) and and puts it in the 1st table (Master_Table). In total there are 4 fields I would change depending on other 4 fields called (CheckRR, CheckQual, CheckProd, CheckCap).
The problem is that it gives me an error 3027, object is read-only.
Below, you can find the code.
Private Sub Comando27_Click() Dim rst As DAO.Recordset Dim rsd As DAO.Recordset Dim supplierName As String Set rsd = Application.CurrentDb.OpenRecordset("Query_Dates", dbOpenDynaset) Set rst = Application.CurrentDb.OpenRecordset("Master_Table" , dbOpenDynaset)
My form respectively subform has a couple of problems related to the recordset as it is available in VBA.
The mainform contains material data, the subform contains the components of that material and a quantity, while the components are materials themselves. The subform's control source is an SQL statement created by the query builder.
Everything worked fine before i replaced the material-selecting combobox in the continuous subform by a textbox and a button. That button leads to another (dialog) form with some filtering options, which in turn returns the number of the selected material. This material gets inserted into the textbox. To this point it works fine.
But when i enter a quantity before i selected a Material, i get an error message after selecting the Material: This Action was Cancelled by an Associated Object. This happens while executing the following VBA Code on click of the material selection button (exact position commented in code):
Code: Private Sub cbuSelectComponent_Click() ' Select component Dim SQL As String Dim rs As Recordset DoCmd.OpenForm "Material Selector Dialog", , , , , acDialog, "Dialog" If GLB_selected_mat = -1 Then 'cancel
[Code] ....
I've found the following Microsoft KB Article: [URL] ..... In their example code they use:
' Restore text box value to the original record contents ' in this case, that is NULL datDataCtl.UpdateControls
I assume this is the relevant part, but i have no DataControl (what's that?) and neither found an UpdateControls method in the subform object.
The second error, "no current recordset", occures when i edit an existing component line in the subform that has been added right before (also using the same event and code as mentioned above). If i close the form after adding the component and open it again, it's no problem.