Hi Guys
This works to populate a drop down box from a text box. Very useful.
---------------------------------
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
strLine = TS.ReadLine ' Read one line at a time
Response.Write ("<option>" & strLine & "</option>"
Loop
End If
---------------------------------
Ive added this to it to give option selected when comparing a recordset value to the textfile values. This however doesnt work, but i cant see what ive done wrong?
---------------------------------
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
strLine = TS.ReadLine ' Read one line at a time
If srtLine = rs("Format" Then
Response.Write ("<option selected>" & rs("Format" & "</option>"
Else
Response.Write ("<option>" & strLine & "</option>"
End If
Loop
End If
-------------------------------------
Cheers in advance
Dave
This works to populate a drop down box from a text box. Very useful.
---------------------------------
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
strLine = TS.ReadLine ' Read one line at a time
Response.Write ("<option>" & strLine & "</option>"
Loop
End If
---------------------------------
Ive added this to it to give option selected when comparing a recordset value to the textfile values. This however doesnt work, but i cant see what ive done wrong?
---------------------------------
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
' use Opentextfile Method to Open the text File
Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
strLine = TS.ReadLine ' Read one line at a time
If srtLine = rs("Format" Then
Response.Write ("<option selected>" & rs("Format" & "</option>"
Else
Response.Write ("<option>" & strLine & "</option>"
End If
Loop
End If
-------------------------------------
Cheers in advance
Dave