API Inform user there is not media in the Drive & which kind of media the user has to insert

R

rebelscum0000

Dear all

Windows XP W/SP2, Access 2003 W/SP3

How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?

Insert Disk Media, CD, DVD or USB...

Please insert a disk, Media, CD, DVD into drive <Drive>:.

For example the user Select Drive (X:), There is not CD into the
Drive..
My Code only ends.. I want to inform user There is not CD into the
Drive, like when the user Click on 31/2 Floppy (A:)

I do not want to call Dir(Drive & ":\*.*")

If there any API, which inform the user
That there is not media, In the X Drive and what kind of Media, the
user has to insert (CD, DVD. Memory Card, USB...)

I.e.

Insert CD

[Icon] Please insert a CD into Drive X:.

[Cancel]


I know the error value is either 75 or 76 then it means that the path
is not found or the drive is not ready

Another problem I have is when the user select A: and there is not
disk
I click on Cancel, the Msgbox close but not my Browse window, how do I
close it?

insert disk

[Icon] Please insert a disk into Drive A:.

[Cancel]



Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
To use in one of these icons in my Msgbox but I do not know how to
extract it any idea?

Thanks in advance

Regards,
Antonio Macias

My code:

Dim MyDlg As New DialogClass 'Common Dialogs Class Module for Access
and VBA
Dim MyDialogResponse As Integer
Dim GetFolder As String
Dim strDrive As String
Dim FirstFolder As String
Dim LastFolder As String
Dim vArr As Variant
Dim itemCount As Integer
Dim j As Integer
Dim strItems As String
Dim TempCRCFile As String
Dim TempTXTFile As String
Dim ccgFF As Integer
Dim egfFF As Integer
Dim amcFF As Integer
Dim newDirectory As String


'On Error GoTo ErrorHandling
'GoTo Replace_First_Process:
'GoTo Replace_Second_Process:
'GoTo Fix_FileExtensions:

'Start Event Open_Windows_Browse
'Opens the Browse Dialog
With MyDlg
.TypeFile = 0 'All file Types
.TypeFile = 4 'Text Files
.DialogType = "Browse"
End With

'Show the select type of dialog selected with the properties
desired
MyDlg.Show

'Waits for the user to click a button, and returns an Integer
indicating which button
'the user clicked .DialogType = "Browse"
MyDialogResponse = Len(MyDlg.ReturnFilePath)

If MyDialogResponse = 0 Then
'User chose Cancel.
MsgBox "User Cancelled", vbExclamation, "Browse"
End
Else
'User Chose OK.
End If

'The name for the chosen file or directory
'Drive>:\ OR <Drive>:\Folder OR <Drive>:\Folder\Folder..
GetFolder = MyDlg.ReturnFilePath
Debug.Print "GetFolder = " & GetFolder
 
G

Guest

How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?
You did not say what program you were working in but I bet it is not Access,
the relational database that is a part of Microsoft Office Professional.
This newsgroup is for Access.

--
KARL DEWEY
Build a little - Test a little


rebelscum0000 said:
Dear all

Windows XP W/SP2, Access 2003 W/SP3

How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?

Insert Disk Media, CD, DVD or USB...

Please insert a disk, Media, CD, DVD into drive <Drive>:.

For example the user Select Drive (X:), There is not CD into the
Drive..
My Code only ends.. I want to inform user There is not CD into the
Drive, like when the user Click on 31/2 Floppy (A:)

I do not want to call Dir(Drive & ":\*.*")

If there any API, which inform the user
That there is not media, In the X Drive and what kind of Media, the
user has to insert (CD, DVD. Memory Card, USB...)

I.e.

Insert CD

[Icon] Please insert a CD into Drive X:.

[Cancel]


I know the error value is either 75 or 76 then it means that the path
is not found or the drive is not ready

Another problem I have is when the user select A: and there is not
disk
I click on Cancel, the Msgbox close but not my Browse window, how do I
close it?

insert disk

[Icon] Please insert a disk into Drive A:.

[Cancel]



Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
To use in one of these icons in my Msgbox but I do not know how to
extract it any idea?

Thanks in advance

Regards,
Antonio Macias

My code:

Dim MyDlg As New DialogClass 'Common Dialogs Class Module for Access
and VBA
Dim MyDialogResponse As Integer
Dim GetFolder As String
Dim strDrive As String
Dim FirstFolder As String
Dim LastFolder As String
Dim vArr As Variant
Dim itemCount As Integer
Dim j As Integer
Dim strItems As String
Dim TempCRCFile As String
Dim TempTXTFile As String
Dim ccgFF As Integer
Dim egfFF As Integer
Dim amcFF As Integer
Dim newDirectory As String


'On Error GoTo ErrorHandling
'GoTo Replace_First_Process:
'GoTo Replace_Second_Process:
'GoTo Fix_FileExtensions:

'Start Event Open_Windows_Browse
'Opens the Browse Dialog
With MyDlg
.TypeFile = 0 'All file Types
.TypeFile = 4 'Text Files
.DialogType = "Browse"
End With

'Show the select type of dialog selected with the properties
desired
MyDlg.Show

'Waits for the user to click a button, and returns an Integer
indicating which button
'the user clicked .DialogType = "Browse"
MyDialogResponse = Len(MyDlg.ReturnFilePath)

If MyDialogResponse = 0 Then
'User chose Cancel.
MsgBox "User Cancelled", vbExclamation, "Browse"
End
Else
'User Chose OK.
End If

'The name for the chosen file or directory
'Drive>:\ OR <Drive>:\Folder OR <Drive>:\Folder\Folder..
GetFolder = MyDlg.ReturnFilePath
Debug.Print "GetFolder = " & GetFolder
 
T

Tony Toews [MVP]

rebelscum0000 said:
How do I inform to the user that there is not media in the Drive in
browse mode AND which kind of media the user has to insert?
If there any API, which inform the user
That there is not media, In the X Drive and what kind of Media, the
user has to insert (CD, DVD. Memory Card, USB...)

If it's anywhere check vbnet.mvps.org. And look in the file I/O
section. At least that's what I think it's called. Internet is down
right now so I can't tell you exactly what to look for.

VB API calls almost always work just fine in Access.
Finally, I want to use an icon from %SystemRoot%\system32\SHELL32.dll
To use in one of these icons in my Msgbox but I do not know how to
extract it any idea?

Do a search on ExtractIcon and ExtractAssociatedIcon. I don't recall
where I found code that I am using in the Auto FE Updater.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top