Help with a function
We have a very complicated function and as you might guess it is complicated because we are not much versed in Access.
Therefore i want to ask for help.
I want to have a common function called Garuda that contains different other fucntions as GarudaLondon,GarudaBerlin,GarudaRome etc.
Depending on the city we are receiving the correspondent module as for example the module GarudaLondon from London.
Each separate module contains the function Garuda where Garuda is equal to the corresponding function.
To be clear i am showing 2 modules:
The module MdlgarudaLondon consists of the following functions:
Public Function Garuda()
Garuda = GarudaLondon
End Function
Public Function GarudaLondon)
Dim strProducts As String
strProducts = ” UPDATE products INNER JOIN productsTemp ON products.Productid = productsTemp.ProductID SET ” & _
” products.branch1 =
.[branch1]+[productsTemp].[cartons],” & _
” products.items1 =
.[items1]+[productsTemp].[quantity]”
CurrentDb.Execute strProducts
End Function
The Modle MdlGarudaBerlin consists of the following functions:
Public Function Garuda()
Garuda = GarudaLondon
End Function
Public Function GarudaBerling)
Dim strProducts As String
strProducts = ” UPDATE products INNER JOIN productsTemp ON products.Productid = productsTemp.ProductID SET ” & _
” products.branch2 =
.[branch2]+[productsTemp].[cartons],” & _
” products.items2 =
.[items2]+[productsTemp].[quantity]”
CurrentDb.Execute strProducts
End Function
So each city sends their modules. We are situated in Paris.So we have here a form and on its OnOpen event is triggered the function Garuda.
I want to remove the recurring in each module function Garuda() that the cities send, and to have only one function Garuda here.This function mujst be able to
recognize one of the preset functions as GarudaLondon,garudaBerlin,etc.
In other words The function garuda to be triggered vif there is a function GarudaLondon,and if there is a function GarudaBerlin,to be equal to GarudaBerlin,etc.
I am pretty sure that there are a lot of simpler solutions to our problem.
Thank you in advance for the help i will receive