473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

API Calls in lieu of Common Dialogs Control

Perhaps a couple of tips regarding API calls using a function module
and I will be on my way to retiring the bug prone Common Dialogs
Controls.

One Common Dialog that I have been using is shown below and has worked
fine. I'm have been using it to copy a few queries in HTML format to
disk. So the main point is how to properly referenced an OutputTo
action when using an API function call. So what should precede the
GetOpenFile?

Of course, I would rather not lose the current features of having a
default string filter placing .HTML as the default in the Save as Type
box, and having a default path specified in the Save In box which is a
very beneficial feature of the current Dialog Control.

Thanks for your time and assistance.

Private Sub cmdOutput_Click()

Me!OutputTo? = GetOpenFile_CLT("C:\", "Save the Output")

' Dim oCmnDlg As CommonDialog
Dim strFormat As String
Dim strFileName As String
Dim stDocName As String
' Set oCmnDlg = Me!cmndlg.Object
On Error GoTo Export_Err
' With oCmnDlg

'.FileName = ""

'.Flags = cdlOFNOverwritePrompt + cdlOFNHideReadOnly

'.CancelError = True

'.Filter = "HTML Format (*.html)|*.html"

'.FilterIndex = 1

'.InitDir = "C:\Program Files\Database\Reports\"

'.ShowSave

'Select Case .FilterIndex

'Case 1
'strFormat = acFormatHTML

'End Select
'strFileName = .FileName
'End With
stDocName = "HTML Output"

DoCmd.OutputTo acOutputQuery, "ReportData", strFormat,
strFileName, False, "C:\Program
Files\Database\Template\ReportDataTemplate.html"

Exit Sub

Export_Exit:
Exit Sub

Export_Err:

If Err.Number = 32755 Or 2501 Then
Resume Export_Exit
Else
MsgBox Err.Number & ", " & Err.Description
End If
Resume Export_Exit

End Sub
Nov 12 '05 #1
1 1662
IF you want a working example of the browse dialog from

http://www.mvps.org/access/api/index.html

Grab shift by pass key example from my web site at:

There is a browse button on a form that opens up the file dialog via api.

http://www.attcanada.net/~kallal.msn.../msaccess.html
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
No************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Lauwers | last post by:
Hello, Is there a way to move the commondialog to a specific position ? Greets John
1
by: Dalan | last post by:
Before distributing a database that I have developed, I thought that I would ask the resident gurus a general question regarding Common Dialogs Control. Correct me if I'm wrong, but I have read...
1
by: Dalan | last post by:
To avoid having potential conflicts and problems with different versions of Common Dialogs Controls, I have decided to change the ones I have used to API calls; however, this is somewhat new...
1
by: SpotNet | last post by:
Hi NewsGroup, I'm (not too) new to C#, I have built a Windows Common dialogs name space with these dialogs contained within. Got all the functionality from these dialogs that C# will let me do...
4
by: Adam | last post by:
I have a form that has a timer running on it (System.Timers.Timer). On this form, I have a button that opens a Common Dialog box. As soon as this button is pressed, the timer stops running. When I...
4
by: Bill Cernansky | last post by:
I've been searching for days for an answer this question, including usenet, the web, and through various books in my Safari subscription. I'm desperate now, because all that searching turned up...
6
by: Steve Barnett | last post by:
I need to include a wizard in my application that will, as one of the steps, ask the user to select a file to open and (later) a file to save it as. The naff way to do this would be to have a...
2
by: MLM450 | last post by:
I am creating various customized open file dialogs. When I display one of my large dialogs followed by one of the smaller dialogs, you can see the smaller dialog resize itself from the larger...
3
by: smellican | last post by:
Is there an easy way to set the starting position of a common dialog such as savefiledialog, printdialog, fontdialog, etc.? There doesn't seem to be a StartPosition property for common dialogs.
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.