Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

questions on drop down list

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
redf1re - 07 Jul 2006 14:10 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.