Hi Everybody.
I know my question is not a big ask for experts here and even for those poeple who have a secure knowledge about MS Access. I am using MS Access 2002 and made a database but i got stuck with Procedure Too Large error. Now i wana split my code into some functions. But I have no idea how to create functions. i have also gone through some tutorials on the web but i failed to get my required results. I need only one Function's procedure to know. if somebody will help me i will be thankful to him/her.
This Database is for a hospital and will be used for Admission and Discharge of Patients.
I made an unbound form named frmUnbound to set values into ExternalDatabase named AdmissionDischarge. I got everything right but that Procedure Too Large error discouraged me a lot.
Now there is cboCity Combo Box (Value List, Limit to List = Yes) and cboRelation Combo Box (Value List, Limit to List = Yes), designation filed (data type = string) and txtADN field (data type = string)
Combo Box cboRelation has values "Self", "Wife", "Husband","Son","Daughter", "Father","Mother","Servant".
Combo Box cboCity has Values "New York", "London", "Toronto" etc.
Designation field based on data entered into the field (text)
Now i wana make function for each Relation in way a that i can get the Admission Number. I can do other coding but can't make function that can return a value.
For example on After Update event of combo box cboRelation's is set then if cboRelation.Value = "Self", this should call a function for this relation and in this function i can run some code to return a admission number into the txtADN field of frmUnbound.
I only wana know how i can make a function to return a value into my form.
i appologize if i am failed to explain my problem cuz my english is not good.
regards
Mohammad Faisal