This does basically the same as JohnCh has given you. But shows the exports for XLS, RTF, SNP and HTML. The appAccess is a variable for Access 2000 application. If you don't pass in one of the formats listed above. The code will open the report within Access and make it visible...
GAORR,
A couple of questions:
1) What is the AddRecord? Is it an Access Query object or a compiled Stored Procedure?
2) If a Query object then how are the parameters passed to the query? Is it only by the order that the query object needs the parameter or is there a named parameter...
This is a bit of code that was pulled from this forum. I cannot remember who exactly it was. Sorry.
Paste into your form
Private Sub Form_Load()
Dim result As Boolean
result = DisableCloseButton(Me)
End Sub
Paste into a module
Option Explicit
Private Declare Function...
Scott,
I don't believe that you can call Querys as if they were Stored Procedures. You may wish to try one of three methods:
1) call the access application object and docmd.openquery for the query you wish to run.
--OR--
2) declare a recordset and openrecordset("<query name>"...
If you wish to look at the second recordset, I believe that you just need to use the following:
Dim adoConn as ADODB.Connection
Dim adoActiveRS as ADODB.Recordset
*********
Create code goes here
also retrieve original recordset.
*********
'Move to the next recordset
set adoActiveRS =...
The following is how I used parameters collected from text boxes and passed into an ADODB.Parameters collection.
Option Explicit
Dim strCnn As String
Dim adoConn As ADODB.Connection
Dim adoParams As ADODB.Parameters
Dim adoCommand As ADODB.Command
Private Sub cmdGetVoterDist_Click()
Dim...
I believe that certain fields within the Object model are Read-Only. But you can always, concatenate the From & Sent Date into a line and add it to the subject or body property.
Or try to use a UserProperty. This of course may not work with your Blackberry unit.
Here is a great site for...
Oops Part II of II cont
Public Function ExportReportToFile(strReportName As String, Optional lngRptType As opgRptType, Optional bolOpen As Boolean = False) As Boolean
Dim strReportPath As String
strReportPath = App.Path & "\"
If Not (appAccess Is Nothing) Then
If...
Part II of II (More difficult, but somewhat documented)
'***************************
'* Calling sub, throughout the following bit of code you
'* will see how to call the functions listed below in
'* modAccessFunction
'*
'* The following is partial, just and example...
Part I of II (Easy)
You can preview a report with the same DoCmd command that you use to print your report.
With appAccess
' Make sure the application is visible.
.Visible = TRUE
'Open the report using the constant you wish acViewDesign
.DoCmd.OpenReport strReportName, acViewDesign, ...
Sample below:
Assume that ADO is referenced within project
Dim cnnNorthwind As ADODB.Connection
'Create the connection.
cnnNorthwind.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Program Files\Microsoft" & _...
AGP,
I haven't tried to do this, but logically this should work. You would have to build your secondary project as an *.exe or *.dll (whatever one you need). Open your primary project and make a reference to your resultant *.exe file. The PDW should read the necessary files for your secondary...
One thing to be careful of fella's. When using the val(NumberAsText) function is that it will convert the numeric representation of the text until it hits a non-numeric character. For most values this should be okay but I believe that the character "," is non numeric. The conversion...
With an ADO recordset you could try to append a new field to the adoRS and then find a way to pass the recordset to your report. Or use a disconnected adoRS for your application, this may be better.
' Dimension your Connection and Recordset
Dim adoConn as Adodb.Connection
Dim adoRS as...
I agree with Bas Schouten. One global connection for your database and then open it when you need it. The environment I work with may lead to this style though. I work with connections to Oracle, or MS SQL and the number of connections your applications keep a hold of is important. You don't...
Antzzz,
Yes, you will want, not necessarily need, to do this for scalability, but the cost is complexity. On the plus side is portability of interface and database, scale of users, plug and play code maintenance (even more so with VS.NET coming), proper location of responsibility (each object...
Tuan3249,
I think what is going on is the following:
I have both Access 97 and Access 2000 running on my machine. If the version of Access that I have opened is MS Access 97, and I am opening an MS Access 2000 database, you will see the Windows Installer kick in. The Installer is not actually...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.