PDA

View Full Version : Undefined Function


mcleyn
Jun 2, 2009, 06:27 AM
I have a form called, frmDetail, which is one of my main forms.
Inside the frmDetail I have a drop down box with a list of different choices.
All of the choices inside the combo box are different forms.
Once the user clicks a form from the drop down box it is taken from a query, called "qryReport" and then opened up.
For example I have a form in the drop down box called "frmCALetter" Once the user clicks this the Letter appears.

Whenever I try to open any of the forms or the qryReport I get the error:
"Undefined Function 'GetLongProjectType' in expression".

Now I have copied the qryReport and frmDetail from a previous database and they have worked fine up until when I am trying to open these forms in the drop down box.

The GetLongProjectType comes from my original database in the qryReport, SQL View. Shown here:

SELECT GetLongProjectType([ProjectType]) AS LongProjectType, GetRegionalProgramOfficer([Province]) AS RegionalProgramOfficer, GetHQProgramOfficer([Province]) AS HQProgramOfficer, GetRegionalOfficeAddress([Province]) AS RegionalOfficeAddress, GetRegionalOfficeTelephone([Province]) AS RegionalOfficeTelephone, tblMain.ProjectCode, tblMain.Province, tblMain.ProjectType, tblMain.ProjectNumber, tblMain.OrganizationName, tblMain.ProjectTitle, tblMain.EventDate, tblMain.ProjectDuration, tblMain.DateReceived, tblMain.ContactFirstName, tblMain.ContactLastName, tblMain.ContactTitle, tblMain.ContactAddressLine1, tblMain.ContactAddressLine2, tblMain.ContactTelephone, tblMain.ContactFax, tblMain.ContactEmail, tblMain.Website, tblMain.SigningSuffix, tblMain.SigningFirstName, tblMain.SigningLastName, tblMain.SigningTitle, tblMain.SigningTelephone, tblMain.SigningEmail, tblMain.TaxNumber, tblMain.ProjectLocation, tblMain.ProjectDescription, tblMain.DateProjectApproved, tblMain.TotalCostOfProject, tblMain.AmountRequested, tblMain.AmountApproved, tblMain.AmountFromPartners, tblMain.LetterOfApprovalNumber, tblMain.DateCASignedByED, tblMain.DateCASignedByProp, tblMain.CAStart, tblMain.CAEnd, tblMain.Status, tblMain.StatusComment, tblMain.SigningAddressLine1, tblMain.SigningAddressLine2, tblMain.SigningTelephone, tblMain.SigningFax, tblMain.SigningEmail
FROM tblMain;

However I have copied the same SQL here into my new qryReport in my new database. And I am still getting the same problem.
Do you have any idea what the problem is or anything I can do?

ScottGem
Jun 2, 2009, 06:42 AM
Your GET... functions are user defined functions. They are VBA code that was setup in the previous database. You have to copy the module that contains those functions as well.

mcleyn
Jun 2, 2009, 06:55 AM
Your GET... functions are user defined functions. They are VBA code that was setup in the previous database. You have to copy the module that contains those functions as well.

OK thank you very much. Could you explaing how I copy the module so the query will work?

mcleyn
Jun 2, 2009, 07:01 AM
Your GET... functions are user defined functions. They are VBA code that was setup in the previous database. You have to copy the module that contains those functions as well.

My apologies for the quote asking you how to copy the module, I have figured it out. Thank you very much for your help indeed.