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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object required 1

Status
Not open for further replies.

tripp2222

Technical User
Nov 30, 2004
32
0
0
US
I am receiving the message "Object Required" trying on this line "Select Case MIFLocation.value". I am trying to populate a drop-down box from an Access database. Can someone show me where I went wrong. I have written code that is basically the same and it is working fine. Maybe my eyes are going bad.

<td align="left">Location:<br>
<select size="1" width="40" name="LocationName" tabindex="1">
<script language="VBScript">
Sub PopulateLocation(MIFLocation)
Set dbLocation = CreateObject("ADODB.Connection")
Dim strConnectionString
Const strDataSource = "\\ssweb\inventory\inventory.mdb"
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&strDataSource&";"
dbLocation.Open strConnectionString
For Each objOption In LocationName.Options
objOption.RemoveNode
Next
Set rstOptions = CreateObject("ADODB.Recordset")
Select Case MIFLocation.value
Case "1" 'SD Group
strSQL = "SELECT * FROM tblLocationLookup WHERE LocationShortName = 'pop'"
Case "2" 'HS Group
strSQL = "SELECT * FROM tblLocationLookup WHERE LocationShortName = 'pop' "
Case "3" 'FS Group
strSQL = "SELECT * FROM tblLocationLookup WHERE LocationShortName = 'pop' "
Case "4" 'Plant Group
strSQL = "SELECT * FROM tblLocationLookup WHERE LocationShortName = 'pop' "
End Select 'PopulateDepartments
rstOptions.Open strSQL, dbLocation
Set objLocationName = rstOptions("LocationLongName")
Set objLocationID = rstOptions("idLocation")
Do While Not rstOptions.EOF
Set objOption = Document.createElement("OPTION")
objOption.Text = objLocationName & " (" & objLocationName & ")"
objOption.Value = objLocationID
LocationName.Add(objOption)
rstOptions.movenext
Loop
dbInventory.close
End Sub
</script>
</select>
</tr>
 
Should that not be done server side?

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
You didn't post the code calling PopulateLocation ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Has MIFLocation been set? Run it up using MSE, set a breakpoint where you create the ADODB connection and see what value MIFLocation has.

MSE or MSE7 lives in either somewhere in Office or somewhere in VisualInterdev, depending on which one you installed first.
 
PHS thanks a lot that was exactly what I needed to do.

Kudos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top