Re: uer

From: Steve Schapel (schapel_at_mvps.org.ns)
Date: 02/04/04


Date: Wed, 04 Feb 2004 23:46:08 +1300

DZ,

Aha! Makes sense now. However, you can't refer to the function by
referencing the form whose class module contains it. And as far as I
know, you can't define a public function in a form's module, I think you
will have to put it in a standard module. Whether the form is open is
not relevant.

-- 
Steve Schapel, Microsoft Access MVP
DZ wrote:
> Thanks for responding Steve.
> 
> I'm sorry for not being clear enough. Let me try to 
> explain more clearly this time.
> 
> I'm creating a query in design view. In one of the column 
> headings in design view of the Query, I want to use a 
> function to create a calculated field.
> 
> So I type a name for the calculated field "NewFieldName", 
> followed by the function. For function argument, I insert 
> the field name, "Field1",  so that the function will 
> process each record in the field named "Field1"
> 
> I have used functions in queries before that were either 
> built-in functions or custom functions that were located 
> in a standard module with no problem.
> 
> So, normally, I would type the following expression in a 
> column heading in the  query (I'm using a built-in 
> function as an example)
> 
> NewFieldName: UCase([Field1])
> 
> But I want to use my custom function and it is not located 
> in a standard module. It is located in the module of a 
> currently open form. The reason that the function is 
> located in the form is that I want to encapsulate all of 
> the functionally of this program inside one form. 
> 
> I need to know the syntax for referring to my function 
> that's located in a form. 
> 
> In a column in query design view, I typed the following 
> but it did not work.
> 
> NewFieldName: Forms!FormName!FunctionName([Field1]) 
> and
> NewFieldName: [Forms]![FormName]!FunctionName([Field1]) 
> 
> Thanks form any help
> 
> DZ


Relevant Pages

  • RE: FE Running Slow with BE on Network
    ... live, production data. ... For instance, when laying out a new report linked to a brand new query, I ... Or if I take the MDB file off site to design at ... Yes, I could put the calculated field in the in the query, which I may do, ...
    (microsoft.public.access.tablesdbdesign)
  • FE Running Slow with BE on Network
    ... For instance, when laying out a new report linked to a brand new query, I ... Or if I take the MDB file off site to design at ... Yes, I could put the calculated field in the in the query, which I may do, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: cant find where to change data type
    ... that allowed me to switch to table design, ... Now, about the query! ... There's the chance you want to create the calculated field on the form instead of the query. ... Open the table and ensure the DefaultValue is 0 for each fld to be summed (If the DefaultValue says Null or is blank, enter a zero). ...
    (comp.databases.ms-access)
  • Re: Date Format Conversion
    ... A calculated field is a field that you put in a query when designing the ... Open your query in design view. ... entire expression (including the MeetingDate: part) into the "Field:" cell. ...
    (microsoft.public.access.queries)
  • RE: Multiply qty of filtered records
    ... If you should want to try doing this with a query (which is probably the more ... etc in the bottom part of the design view. ... I do know how to get this information in a Report, ... Dim rs As DAO.Recordset ...
    (microsoft.public.access.modulesdaovba)