Francisco_M
asked on
visual basic functions
hi there, I've created a function that should return results on a datalist object:(here are the codes):
======
Public Function myactive_users(current_lis t As datalist)
Adodc1.ConnectionString = "DSN=mydsn"
Adodc1.RecordSource = "select distinct myUsers from myTable order by Myuser"
Adodc1.Refresh
current_list.DataField = "myUsers"
current_list.ListField = "myUsers"
Set current_list.DataSource = Adodc1
Set current_list.RowSource = Adodc1
End Function
=========
Now, when I call this function to populate results on another datalist, the compiler tells me "error mismach". This is what I am doing: myactive_users(this_datali st1)
Anybody can help on how to do that properly?
I will apreciate ur help.
F.
======
Public Function myactive_users(current_lis
Adodc1.ConnectionString = "DSN=mydsn"
Adodc1.RecordSource = "select distinct myUsers from myTable order by Myuser"
Adodc1.Refresh
current_list.DataField = "myUsers"
current_list.ListField = "myUsers"
Set current_list.DataSource = Adodc1
Set current_list.RowSource = Adodc1
End Function
=========
Now, when I call this function to populate results on another datalist, the compiler tells me "error mismach". This is what I am doing: myactive_users(this_datali
Anybody can help on how to do that properly?
I will apreciate ur help.
F.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with emoreau, and remember, your datalist object "this_datalist1" must be initialized before passing it to the function myactive_users.
Hope u sucess.
Hope u sucess.
ASKER
THANKS emoreau,
It worked!
Sorry to reply so late!
It worked!
Sorry to reply so late!
[VB.NET]
Public Function myactive_users(current_lis
Return ???_What_Object_Of_The_Giv
End Function
In VB6, you'd use:
myactive_users = ???_What_Object_Of_The_Giv
instead of the Return statement.