access-vba

Ms Access Save record in subform

I have a main form with a tab control containing multiple subforms. I need to be sure that the data in a subform is saved when the user switches tabs. The problem is that DoCmd.RunCommand acCmdSaveRecord seems only applies to the current form so it doesn't save the data in the subform. I have tried different events on the subform such a...

How can I Export a Table in Access using VBA into a specific sheet in an Excel spreadsheet?

I have a some tables, we will call them Table1,Table2.... and I need them to be Exported into specific spreadsheets in a macro enabled Excel File (.xlsm) that already exists. So I would need to put Table1 into Sheet2, Table2 into Sheet3... and so on. I had been doing this manually by going to the export menu in Access but it is getting m...

Unable to remove master -> child subform links in microsoft access 2003

Hi, I am having an issue removing the master -> child link fields in an access subreport data form. I have tried every avenue to remove them, using the properties window of the subreport as well as the link wizard. I have also deleted the subreport from the database and then gone as far as re-importing the existing objects into a new ...

ACCESS.Visual basic. Make treeView object

I have a database(3 tables). I want to build treeView. I don't know how to create recordset and how to retrieve record from it. ...

MS Access group development

We are planning to redesign quite a huge MS Access application. Is there any way to work concurently on the same application or is it possible to merge two seperate instance of the same file (not the data, but the forms and code). Now Access contains the data, but in the future version MySQL will host the data and Access will be only the...

Retrieve Value Using Key From a Collection in Access 2000

I know this is a simple question but it's aggravating me. If I have a key/value pair in a collection but I can't seem to get the value out using the key. I can get the key using the value but not vice versa. Is there some magical way to accomplish this? For example: Dim CycleList As Collection Dim Value as String Set CycleList = New Co...

Upload a .pdf file to a Sharepoint Document Library using Access vba

Within an Access 2007 application, I'm creating a static report in .pdf format. I want to create it, then export the static report (not the data itself) to a Sharepoint Document Library. The intent is for it to be a public repository, no versioning. Each report will carry a unique name. I'm a seasoned vba programmer, but using Sharepoin...

Executing Javascript in WebBrowser Control stopped working after upgrade to Access 2010

BACKGROUND: The following works in Access 2007, but broke when I installed 2010 I have a WebBrowser control in an Access Form; I set its location as follows Me.WebBrowser0.ControlSource = "http://foo.com" and then execute a script in the page Script = "StartScript(null);" Me.WebBrowser0.Object.Document.parentWindow.execScript Scr...

How to compare 2 similar strings letter by letter and highlight the differences?

We have 2 databases that should have matching tables. I have an (In-Production) report that compares these fields and displays them to the user in an MS-Access form (continuous form style) for correction. This is all well and good except it can be difficult to find the differences. How can I format these fields to bold/italicize/colo...

Access VBA question: Change the query being referenced by a function, depending on context

I have a custom function in Access2007 that hinges on grabbing data out of a specific query. It opens Outlook, creates a new email and populates the fields with specific addresses and data taken from the query ("DecisionEmail"). Now I want to make a different query ("RequestEmail") and have it populate the email with that data. So all I ...

MS Access-VBA _ Save a Report to Hard Drive

Hi all, need some help with this code if anyone can answer. Any suggestions are most appreciated. I have a report that I want to save to my hard drive when clicking a button. When saving the report I want the filename to be created using two pieces of information from the report. Variables: Report = "Contract" Save Location = "C...

Open an Access database and run one of its Macros from Excel

From Excel, I need to open an Access database and run one of the database's macros. I'm using Excel and Access 2007. Here is my code in Excel: Sub accessMacro() Dim appAccess As New Access.Application Set appAccess = Access.Application appAccess.OpenCurrentDatabase "C:\blah.mdb" appAccess.Visible = True appAccess.D...

Best way to read an Excel file into an Access 2007 database

What's the "best" way to read (just read) an Excel file from within an Access 2007 application. I only want to loop trough the rows and put the data into an Access table. I don't want a import by hand (Get External Data dialog) but by VBA. The user gets a Form with a Browse button and then points to a Excel file with a defined content/f...

Access 2007 VBA & SQL - Update a Subform pointed at a dynamically created query

Abstract: I'm using VB to recreate a query each time a user selects one of 3 options from a drop down menu, which appends the WHERE clause If they've selected anything from the combo boxes. I then am attempting to get the information displayed on the form to refresh thereby filtering what is displayed in the table based on user input. ...

MS Access 2007 - Warning box everytime the database is opened is different from 2003

Everytime I open my mdb copy to work on something, I get this little warning label that some somethings have been blocked....click this button to un block? anyway I can default that off? thanks justin ...

MS Access 2007 - Property for text box to allow end-user to hit enter for return, not next

So I have a form that user's use for data entry, and on one form there is a text box there that is basically used. To enter notes. However, if the user hits i need the cursor to stay in that text box, and start a new line (uh....like word would)....but currently it is jumping to the next control (text box). So is there a simple proper...

Access 2007 VBA : Building a listbox with selection choices from another list box

So there are 8 categories that may be associated to each order, but not necessarily all of them. So i was going to build a list box that allowed the user to double click each of the category they wish to associate when they have an "Order Detail" form opened up (unbound form that has hidden text boxes with all needed ID numbers). I want...

ACCESS VBA - DAO in VB - problem with creating relations

So take the following example: Sub CreateRelation() Dim db As Database Dim rel As Relation Dim fld As Field Set db = CurrentDb Set rel = db.CreateRelation("OrderID", "Orders", "Products") 'refrential integrity rel.Attributes = dbRelationUpdateCascade 'specify the key in the referenced table Set fld = rel.CreateField("OrderID") fld....

Access 2007 - cycling through values in a list box VBA?

So i have a list box that populates with different sets of data based on user selections. How can I cycle through any given values that may be in the list box? Is this a For Each statement, or what? Please help thanks justin ...

How can I specify processor affinity?

I have an application that's having some trouble handling multi-processor systems. It's not an app that I have a particular affection for modifying and would like to avoid it if possible. However, I'm not above modifying the code if I have to. The application is written in VBA (and hence my inclination to avoid touching it). We've no...