Hi,
How do I use a CommonDialog ActiveX X control in Access 2000?
The methods and properties are not the same at all than in VB...
Can someone tell me where I can find some Docs?
'You can try to use code what I used for saving of my reports. You may create new form, then add into form 1) "Microsoft Common Dialog control, vrsion 6.0" (MsComCtl.ocx), name it 'cmnDialog'; 2) text box, name it 'txtLocation'; 3) command button, name it 'pbBrowse". Then copy following code. Open form, push command button. Dialog window will appear.
Private Sub pbBrowse_Click()
On Error GoTo Err_pbBrowse_Click
Dim strFilter As String
Dim objDialog As Object
Set objDialog = Me.cmnDialog.Object
strFilter = "Rich Text Documents|*.rtf;All files|*.*"
With objDialog ' Ask for new file location.
.DialogTitle = "Save Report As..."
.FileName = "MyReport"
.InitDir = "C:\"
.Filter = strFilter
.FilterIndex = 1
.Flags = &H4 Or &H2 Or &H800 Or &H400 'cdlOFNHideReadOnly Or cdlOFNOverwritePrompt Or cdlOFNPathMustExist
.ShowSave 'Or:
'.ShowOpen
' If user responded, put selection into textbox on form.
If Len(.FileName) > 0 Then
Me.txtLocation = .FileName
End If
End With
Exit_pbBrowse_Click:
Exit Sub
Err_pbBrowse_Click:
If Err.Number <> 32755 Then 'An error 32755 is generated
'when the user chooses the Cancel button.
MsgBox Err.Number & ": " & Err.Description
End If
Resume Exit_pbBrowse_Click
End Sub
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.