Passing ado names to a sub or function

I want to use a common function/sub routine to load data to a number of different ado's. Can i pass the ado name to the function and then reference the ado via the passed name? Below is the code i have tried which has not worked but gives an idea of what i am trying to do.

sub sub_Load_Array(str_String as String, str_Name as String)

frm_Basecoat_Esta.[str_name].RecordSource = str_string

end sub

str_String is the passed sql statement for the record source
str_name is the passed ado name, for example ado_Main_Needle

Any ideas would be most welcome

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!