Hello all!!im filling a dropdown list with results from a query as th
code shows (i fill the drop down everytime i open the xls file), BU
this dropdown keeps all information when i close the file and when
run the code again the result is merged into the older, i need to clea
the dropdown in this code before i fill it again!!! i tried .Clear bu
excel says it doesnt belong to the object class..i dunno what to do
> Sub Auto_Open()
>
> Const strActiveConnection
> "DSN=TURMALINA;Description=TURMALINA;;;APP=Microsoft Offic
> 2003;WSID=GENERATOR;DATABASE=JDE_DEVELOPMENT;Network=DBMS"
>
> Const strSQL = "SELECT " & _
> "prj = CONVERT(VARCHAR(4),F58009.IMPRJCOD) + '-'
> CONVERT(VARCHAR(4),F58009.IMSEQ) + ' - '
> LTRIM(RTRIM(F58001.PDDSCA))+ ' - ' + LTRIM(RTRIM(F58009.IMDSCA)), "
> _
> " prj2 = CONVERT(VARCHAR(4),F58009.IMPRJCOD) + '-'
> CONVERT(VARCHAR(4),F58009.IMSEQ) " & _
> " FROM JDE_DEVELOPMENT.TESTDTA.F58009 F58009, " & _
> " JDE_DEVELOPMENT.TESTDTA.F58001 F58001 " & _
> " WHERE F58001.PDPRJCOD = F58009.IMPRJCOD"
>
> Dim cnx1 As Object
> Dim rst1 As Object
>
> Set cnx1 = CreateObject("ADODB.Connection")
> Set rst1 = CreateObject("ADODB.Recordset")
> cnx1.Open strActiveConnection
> rst1.Open strSQL, cnx1
> Set ExecuteSQL = rst1
>
> Dim Count As Integer
> Count = 0
>
> Do While Not rst1.EOF
> ActiveSheet.Shapes("Drop-Down 10").Select
> With Selection
> .AddItem rst1("prj")
> End With
> Count = Count + 1
> ReDim Preserve ArrayAux(1 To Count)
> ArrayAux(Count) = rst1("prj2")
> rst1.MoveNext
> Loop
> rst1.Close
> Set rst1 = Nothing
>
> End Sub
someone to help me please
redf1re - 07 Jul 2006 14:13 GMT
i also need to know whats the macro name when the user select somethin
in the drop down list.
Thank You,
tyag