Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Reference Form Field through a Module

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sandog - 01 Feb 2008 15:47 GMT
Is there a way that I can reference a form feild through a module?

I used this in the class objects code for the Form and it worked fine?
   Label373.Visible = True
   Label377.Visible = True

When I add the code to the Module and compile it I get an error,
"invalid qualifier"

I tried a few different things,
1. tried initializing the variables
       Dim Label373 As String
       Dim Label377 As String

2. tried calling out the Form and the field.
   Forms(Form_CattHBApp).Conrols(Label373.Visible) = True
   Forms(Form_CattHBApp).Conrols(Label377.Visible) = True

I still get the error "invalid qualifier" when i tried this.

Stil can't get it to work.

Help please....

thanks
Dirk Goldgar - 01 Feb 2008 15:56 GMT
> Is there a way that I can reference a form feild through a module?
>
[quoted text clipped - 15 lines]
>
> I still get the error "invalid qualifier" when i tried this.

I gather that your form is named "CattHBApp".  I believe, then, that what
you need in your module is this:

   Forms!CattHBApp!Label373.Visible = True
   Forms!CattHBApp!Label377.Visible = True

... although this would also work:

   Forms("CattHBApp").Controls("Label373").Visible = True
   Forms("CattHBApp").Controls("Label377").Visible = True

Note that the form must already be open when this code runs.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

sandog - 01 Feb 2008 16:56 GMT
On Feb 1, 10:56 am, "Dirk Goldgar"
<d...@NOdataSPAMgnostics.com.invalid> wrote:

> > Is there a way that I can reference a form feild through a module?
>
[quoted text clipped - 33 lines]
>
> (please reply to the newsgroup)

That Worked!!!

Thanks
Sandon
sandog - 01 Feb 2008 20:56 GMT
> On Feb 1, 10:56 am, "Dirk Goldgar"
>
[quoted text clipped - 45 lines]
> Thanks
> Sandon

Ooops.... I need some more help.
As you noted, "the form must be open when i run this code".

Well it runs perfect when I have that form open, but I get an error
message when I open another form.

Can you help me write an If statement that will check for the form?

thanks
Dirk Goldgar - 04 Feb 2008 17:44 GMT
> As you noted, "the form must be open when i run this code".
>
> Well it runs perfect when I have that form open, but I get an error
> message when I open another form.
>
> Can you help me write an If statement that will check for the form?

I'm not sure what you have in mind.  What do you want to have happen if form
CattHBApp is not open?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.