Re: Passing form name to generalized procedure
From: Brendan Reynolds (brenreyn)
Date: 02/24/05
- Next 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"
- Previous message: Frank Hickman [MVP]: "Re: Copy between identcal tables"
- In reply to: Richard: "Passing form name to generalized procedure"
- Next in thread: Richard: "Re: Passing form name to generalized procedure"
- Reply: Richard: "Re: Passing form name to generalized procedure"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 13:41:01 -0000
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: Gabriel Mejía: "Re: sometimes it returns error message: Either BOF or EOF is true in my asp page and it has valid data"
- Previous message: Frank Hickman [MVP]: "Re: Copy between identcal tables"
- In reply to: Richard: "Passing form name to generalized procedure"
- Next in thread: Richard: "Re: Passing form name to generalized procedure"
- Reply: Richard: "Re: Passing form name to generalized procedure"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|