Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form does not open on win 98 or 2000

Status
Not open for further replies.

instructorTek

Instructor
Jun 5, 2006
61
Hi can anyone help. I have an app written using Access 2003, a particular form in the app uses windows API functions in addition to the VBA. This form does not open on win 98 or win 2000 operating systems, although Access 2000 is installed. It opens in win ME and XP with Access 2000. I downloaded a win 98 scripting update from Microsoft but the form still did not open, only the grey Access screen remains visible when the form is opened. Any help will be appreciated. The code is as follows:
Private Sub Form_Open(Cancel As Integer)

'Determines the drive letter of CDROM and checks for a file on the CD
'The CD must be in the drive for the user to continue
Dim strDriveLetter As String
Set fso = CreateObject("Scripting.FileSystemObject")

For Each drv In fso.Drives
If drv.drivetype = 4 Then
strDriveLetter = drv.driveletter
End If
Next

If Not fso.FileExists(strDriveLetter & ":\test.txt") = True Then
DoCmd.Close
DoCmd.OpenForm "frmNoCd", acNormal, "", "", , acNormal
End If

End Sub
 
Double check the references:
when in VBE, menu Tools -> References ...
Does the DB compiles properly ?
menu Debug -> Compile ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried what you said PHV, the code compiles without any errors, when I checked the references the following available references were checked:

Visual Basic For Applications
Microsoft Access 10.0 Object Reference
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
msinfo32 1.0 Type Library

Any help with this will be appreciated.
 
Microsoft Access 10.0
You talked about an app written using Access 2003 (11.0) and ran with Access 2000 (9.0), so why have you a reference to Access XP ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm sorry there was an error in the typing the app was created using Access XP. If I comment out the scripting code the form opens on win 98 using Access 2000. Any ideas on this PHV?
 
Could it be that the msinfo32 1.0 Type Library needs to be updated on win 98 and win 2000. Could it be that the follow code, used on the form, gets the information about the cdrom drive from this library file?

code:
Set fso = CreateObject("Scripting.FileSystemObject")

For Each drv In fso.Drives
If drv.drivetype = 4 Then
strDriveLetter = drv.driveletter
End If
Next

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top