Re: Passing form name to generalized procedure
From: Richard (richard_at_discussions.microsoft.com)
Date: 02/24/05
- Next message: Stephen Howe: "Re: Returning Null value instead of contents of field"
- Previous message: Gabriel Mejía: "Re: sometimes it returns error message: Either BOF or EOF is true in my asp page and it has valid data"
- In reply to: Brendan Reynolds: "Re: Passing form name to generalized procedure"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 08:31:03 -0800
Thanks for the help.
"Brendan Reynolds" wrote:
> I'm assuming this is an Access form?
>
> If so, an example would be ...
>
> Public Sub TestFormRef(ByVal strFormName As String, ByVal strControlName As
> String)
>
> Debug.Print Forms(strFormName).Controls(strControlName).Value
>
> End Sub
>
> Example of use in the Immediate window ...
>
> testformref "frmTest","TestText"
> My Test Text
>
> BTW: This question doesn't seem to have much to do with ADO, and might have
> been better asked in an Access newsgroup such as
> microsoft.public.access.formscoding
>
> --
> Brendan Reynolds (Access MVP)
>
> "Richard" <richard@discussions.microsoft.com> wrote in message
> news:06239396-DB72-4BDA-8CAA-B3F6A4610131@microsoft.com...
> >I have a generalized procedure to process data entered into text boxes, for
> > use with multiple forms. The name of the current form is passed as a
> > String
> > variable to the procedure. When the procedure attempts to use the
> > variable
> > to process a field ( i.e., Forms!frmNameVar(FieldName) ) an error message
> > says that the module "can't find the form 'frmNameVar' referred to " in
> > the
> > code. If I substitute the actual name of the calling form into the VBA
> > code,
> > the procedure works properly.
> >
> > How do I pass a form name to a generalized procedure and reference it to
> > process text fields that are in the form?
> >
> > Richard
>
>
>
- Next message: Stephen Howe: "Re: Returning Null value instead of contents of field"
- Previous message: Gabriel Mejía: "Re: sometimes it returns error message: Either BOF or EOF is true in my asp page and it has valid data"
- In reply to: Brendan Reynolds: "Re: Passing form name to generalized procedure"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|