This is funny:
Now I'm receiving this Run-Time Error 3014:
Cannot open more tables....
Rookie stuff for sure

can you gimme an hand with this first...
:
OK!
Try makin the function Public:
Public Function update(period As String)
End Function
And call the function like this:
update(period)
But if I´m not totally out of line you need to place the
function/functions
in a standard code module and not in a form code module. Besides I asume
that period in update(period) is a varaible that have been declared
somewhere and appended a value. You don´t specifye this so I asume that
so
is the case.
Do you get any runtime error when you try to run your code?
// Niklas
OK!!!
Note that I'm only having trouble about the syntax in the instruction
Forms(form_name)![subform_name].Form.update(period)
But here it goes....
Function update(period As String)
Dim bd_update As Database
Dim qdf_update As QueryDef
Dim rst_update As Recordset
Set bd_update = CurrentDb
Set qdf_update = bd_update.CreateQueryDef("", SQL instruction to query
external database ")
Set rst_update = qdf_update.OpenRecordset()
With rst_update
Do While Not .EOF
DoCmd.RunSQL (" SQL instruction to INSERT records in table
")
.MoveNext
Loop
.Close
End With
End Function
:
What does the functions do? Can you post an example?
// Niklas
message
Ok!
I have a form that includes many subforms
Each subform is linked to a different table.
When I open the form, the code written on the module checks each
of
the
subform's tables and decides whether to update or not its table.
Now, the function I'm trying to call from the module is written in
each
subform code (the function name iis the same for every subform,
but
its
content is different), that's why I need to call the function
using
the
subform name being a variable depending on which subform's table
needs
update...
I hope I've been clearer enough....
Thanks...
:
Hi!
It´s a little bit tricky to understand what you are trying to
acomplishe
here. So please give us more information.
What do you want the function to do?
To be able to use a function or sub in a form you need to store
the
function/sub in a code module instead of in a form code moduel.
And
you
need
to declare it as public.
Please give us more information of what you are trying to do!
// Niklas
message
Hi,
I'm trying to call a subform function from a module.
I was using this instruction:
Forms(form_name)![subform_name].Form.function_name
The problem is that I would like the subform_name to be a
variable...
Please give me a help
Thanks...