-
Oct 18th, 2016, 09:54 AM
#1
Thread Starter
Banned
plz help me to sort it out
hello all.
Im getting hdd serial with
Set d = Fso.GetDrive(Fso.GetDriveName(Fso.GetAbsolutePathName("E:\")))
however, if there is no E:\ drive on client system, then it gives runtime error 68/71 disk not ready/device unavailable.
instead of this error, I want to show frm_info if E:\ is not available.
how can i do it.
Thanks in advance
-
Oct 18th, 2016, 11:02 AM
#2
Thread Starter
Banned
Re: plz help me to sort it out
Admin i posted this thread in code bank by mistake....kindly move it to vbforums. Thanks.
-
Oct 18th, 2016, 11:07 AM
#3
Re: plz help me to sort it out
Use OnError to catch the error and show the form instead?
-
Oct 18th, 2016, 11:29 PM
#4
Thread Starter
Banned
Re: plz help me to sort it out
i already used OnError goto handler ....handler : frm_error.show, but this also show the main form along-with error form, however, does not show any hdd serial on main form,
-
Oct 19th, 2016, 06:25 AM
#5
Re: plz help me to sort it out
Well, it wouldn't show any hdd serial on the main form if you had an error trying to get the hdd serial because their wasn't an E: drive.
And I thought you said
instead of this error, I want to show frm_info if E:\ is not available.
so why would you be doing "frm_error.show" instead of doing "frm_info.show if E:\ is not available"?
Code:
Option Explicit
Private Sub Command1_Click()
Dim fso As New filesystemObject
Dim d
On Error GoTo skipit 'don't show the error dialog, inform the user E isn't available
Set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName("E:\")))
Exit Sub
skipit:
Debug.Print "E: not available"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|