Object reguired error when I try to assign value to a string.

M

Mike Johnson

Line 7 below produces the error Object reguired. Does anyone know why? Please
help. thanks.

Private Sub Form_Activate()
Dim strPath As String
Dim fs, f
Dim Def(2) As String

strPath = Me.Application.CurrentProject.Path
strPath = strPath + "\" + Config.txt ' this line gives the error.
Me.Visible = False
'Get Default values from Setup text file. Config.txt
Const ForReading = 1

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(strPath, ForReading, TristateFalse)
Def(1) = f.Readline
Def(2) = f.Readline
f.Close

Def_Dis = """" & Def(1) & """"
Def_CC = Def(2)
DoCmd.OpenForm "Switchboard", acNormal

End Sub
 

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