access-vba

Why does createProcessingInstruction in VBA generate incomplete output?

The following VBA code generates <?xml version="1.0"?> as output. Dim XML As New DomDocument Dim pi As IXMLDOMProcessingInstruction '.... some code that sets the root element of the document Set pi = XML.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'") XML.insertBefore pi, XML.documentElement Why is the ...

Parsing a web form in to a data table

Hi to all, has anyone an idea of how to write a dynamic data parser in VBA to capture data from a text file and input it in to a database table (ms access)? The form has about 55 fields, so I'd rather write a code that is capable of picking up the field name from the text than copying a load of text. Is there a smart way to do this and a...

Openform action was canceled in MS-Access VBA code

Hi, I am supporting an application which was running for the past 3 years. It was developed completely in MS Access and written in VBA. Suddenly the application is facing the mentioned error at the following lines: DoCmd.OpenForm FormName:="frmNewPeerGroup", View:=acNormal, windowmode:=acWindowNormal, OpenArgs:=5 FrmNewPeerGroup cod...

Version control for VBA file

I have a huge MS Access document with built-in VBA codebase. Is it possible to track the file (as I am developing it) with a (mercurial) version control system? Can I extract code and track that? Or is it just the-binary-file-path? Thanks. ...

How can I change the view of an MS Access subform at runtime in VBA code?

This seems like it would be a simple affair, and I am sure I have done this before, but it has been a while since I have done any UI programming in Access. What I need to do is put a button on a form to toggle between datasheet and form view for a subform. I have found a defaultview property, but nothing that looks like it would toggle ...

Inspect Call Stack in VBA

Would It be possible to see Stack in VBA (MS Access 2003). I mean Would it be possible to see what procedure or function this function was called from... ...

Getting Value from MS Access form from Excel VBA.

What is the best way to check is access form is open and get the value of textbox using Excel VBA. I mean is there a way to check if MS Access application is running and if it is then check certain form is open then get the value from this form's textbox field. Something like If MSAccess.([Application name]).Forms("FormName").isOpen...

Access - Data Provider Not Initialised?

I have used Access 2003 to develop a frontend to a SQL Server database. Because the system was intended to use different Schemas to partition the table data, an Access Project did not work. So, instead, I am forced to take over the connection management for access - I maintain a global connection object, and assign recordsets to Forms ra...

Queries in ms-access:formatting a field in the middle of an sql UPDATE code.

Hello again, I am having yet another problem with my data in ms-access. Basically, what i'm doing is using multiple sql statements to pull, sort, and staight up change/manipulate data. The problem that im having currently is that i am trying to use a sql code like this: UPDATE analyzedCopy2 SET analyzedCopy2.DateRange = #4/21/2009# to ...

How to use VBA to automate several Office applications?

Although I've done VBA projects within a single application for both MS Access 2007 and Excel 2007, I haven't automated multiple applications at the same time. The generalized project is to open access, run some update queries that appends data to various tables. Then Excel needs to get the data. Some formating changes are needed in E...

SQL for parsing multi-line data?

I have the unfortunate task of having to import data from excel into a database on a regular basis. The table looks something like this: IssueID References 1234 DocID1<cr>DocID2<cr>DocID3 1235 DocID1 1236 DocID2 1237 DocID2<cr>DocID3 References is a multi-line text field. What I'm trying to do is cr...

Is there a way to execute VBA code when specific tables and fields in a Microsoft Access database are updated?

I have a program that uses a Microsoft Access database for its back-end. I need to have some VBA code (that calls a web service) execute whenever specific tables/fields are updated by the program. I see this working just like a trigger in SQL Server. Is it possible to monitor for and act upon changes like this in Access? Update The pro...

Access VBA save Report as PDF/Binary

I am using Access 2007 (VBA - adp) front end with a SQL Server 2005 Backend. I have a report that i want to save a copy as a PDF as a binary file in the SQL Server. 1, Report Opened . 2, Report Closed - Closed Event Triggered. 3, Report Saved as PDF and uploaded into SQL Server table as Binary File. Is this possible and how would i ac...

Show code from from thru code (in ms access)

making an Access database (2003) that is mainly used by other programmers and tech management as a tool for data validation. I want to put an button on parts of the form that runs code, to show the code that is being run. So the programmers can edit it on the spot. This is for a data validation project with frequent changing of code. ...

DCount vs. SQL SELECT COUNT(*)?

I am trying to get a count of all items sent to a supplier based on the purchase order they are assigned to. But I can't seem to get the control to show a number of items based on the purchase order instance - it keeps throwing either a #name? or #error! message in the text box when the form is activated. Create statement for tblPODeta...

How do I change a column's Format to Percent using a SQL in VBA?

I have a query in VBA that Adds a few columns to a table. How can I change the format of the PercentSuccess column to Percent using SQL in VBA? Here is the code I'm using to add the columns. strSql5 = " Alter Table analyzedCopy3 " & _ "Add Column PercentSuccess Number, Success Number, prem_addr1 TEXT(50) " DoCmd.SetWarnings Fals...

ms-access vba Eval function behavior

I have a public function in access form Public Function PopupProcess() as long MsgBox Me.ActiveControl PopupProcess = 1 End Function when i call eval("forms('MyForm').popupprocess") it shows message box 2 times. Does anybody know why it does that? I Have Access 2003 with SP3. thanks. EDIT : Main idea is to call function from ...

How to be productive in Access VBA + SQL development?

I'm a 80% ruby on rails developer, but still need to do some Access VBA work. Some of them are very shit systems, been build ages ago , used by the big enterprise globally , so that most of the works are just enhance the old system. The techniques are basically MS Access as front-end, linked-table which link to SQL server via ODBC as b...

How to use a Query in another DB as a Form's RecordSource?

I'm trying to split a database into two pieces -- a backend that updates automatically, and a front-end that allows searching and adding/editing comments. The data in the source database is pulled together from multiple tables into a pair of queries, and I want to use these queries as the source of the current database. Access 2007 s...

Problem of input mask in VBA text box ?

There is a problem in VBA text box while filling input mask property: I am trying to make the combination of date and time: Hence i put it like below: 00/00/00;0;_00:00;0;_ But while running the application, i am only getting 00/00/00 (Date). But i remember, i got the result as like 00/00/00 00.00 as expected when i first put the ...