Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Undefined function error
I keep getting the undefined function error when executing my code, although
it has already been defined. both functions are defined as public sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Undefined function error
Post your code.......maybe someone can help.
Vaya con Dios, Chuck, CABGx3 "CLamar" wrote: I keep getting the undefined function error when executing my code, although it has already been defined. both functions are defined as public sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Undefined function error
"CLamar" wrote: I keep getting the undefined function error when executing my code, although it has already been defined. both functions are defined as public sub. InitialSelec inside the SQL statement with the asterisks is when the undefined error pops up. Function InitialSelec() 'Assigns the selected value inside the List Box to a variable For w = 0 To Sheets("Sheet1").LstBatchnum.ListCount - 1 If Sheets("Sheet1").LstBatchnum.Selected(w) Then _ Selec = Selec & Sheets("Sheet1").LstBatchnum.List(k) InitialSelc = Selec Next w End Function Set Recordset = New ADODB.Recordset With Recordset Call InitialSelec **Src = "SELECT * FROM tblResults WHERE Batch = InitialSelec()" .Open Source:=Src, ActiveConnection:=Connection2 'For Col = 0 To Recordset.Fields.Count - 1 ' Sheets("Sheets3").Range("A1").Offset(0, Col).Value = Recordset.Fields(Col).Name 'Next Sheets("Sheet3").Range("A1").Offset(1, 0).CopyFromRecordset Recordset 'Copies the data inside the recordset into a List Box For Row = 2 To Recordset.Properties.Count - 1 Sheets("Sheet1").LstTirenum.AddItem Sheets("Sheet3").Cells(Row, 4) Next Row End With |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Undefined function error
Maybe..........
InitialSelec = Selec instead of InitialSelc = Selec Vaya con Dios, Chuck, CABGx3 "CLamar" wrote: "CLamar" wrote: I keep getting the undefined function error when executing my code, although it has already been defined. both functions are defined as public sub. InitialSelec inside the SQL statement with the asterisks is when the undefined error pops up. Function InitialSelec() 'Assigns the selected value inside the List Box to a variable For w = 0 To Sheets("Sheet1").LstBatchnum.ListCount - 1 If Sheets("Sheet1").LstBatchnum.Selected(w) Then _ Selec = Selec & Sheets("Sheet1").LstBatchnum.List(k) InitialSelc = Selec Next w End Function Set Recordset = New ADODB.Recordset With Recordset Call InitialSelec **Src = "SELECT * FROM tblResults WHERE Batch = InitialSelec()" .Open Source:=Src, ActiveConnection:=Connection2 'For Col = 0 To Recordset.Fields.Count - 1 ' Sheets("Sheets3").Range("A1").Offset(0, Col).Value = Recordset.Fields(Col).Name 'Next Sheets("Sheet3").Range("A1").Offset(1, 0).CopyFromRecordset Recordset 'Copies the data inside the recordset into a List Box For Row = 2 To Recordset.Properties.Count - 1 Sheets("Sheet1").LstTirenum.AddItem Sheets("Sheet3").Cells(Row, 4) Next Row End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How too set last edited date in excel and which user was it? | Excel Worksheet Functions | |||
Why sometimes excel returns error just because function parameters are linked? | Excel Worksheet Functions | |||
Function giving error | Excel Discussion (Misc queries) | |||
Function giving Error | Excel Worksheet Functions | |||
Custom function returning VALUE error | Excel Discussion (Misc queries) |