Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:04:24+00:00 2026-06-13T21:04:24+00:00

In my MS Access application, I am using a form which contains only two

  • 0

In my MS Access application, I am using a form which contains only two controls – a textbox and a command button. This form is named as HEADER FORM.

HEADER FORM is used as a subform in header section of various other forms.

What I want to do is that whenever a particular form loads, I want to fill details in the textbox of the HEADER FORM (that will be name of the person who has logged in. The same would be clear from the picture below).

I am trying to call a global subroutine named updateHeader in form load event of all the forms.

Public Sub updateHeader()
    Me![HEADER FORM].Form.txtHeaderName.Value = strPerson
End Sub

Following is the picture showing HEADER FORM in Design View and the same being used as a subform in a login form.

enter image description here

I tried various other options but am not able to come out with the correct way to reference the form. Am I doing something wrong fundamentally?

The error that I am seeing is invalid use of Me keyword.
Also, my updateHeader subroutine is a global subroutin which is called from Form_Load event of all the forms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:04:26+00:00Added an answer on June 13, 2026 at 9:04 pm

    If your updateHeader() procedure is contained in a standard module, that would explain the complaint about the Me keyword … it’s not valid in a standard module.

    In a form module, Me means “this form”.

    You could change the procedure declaration to accept a reference to a form.

    Public Sub updateHeader(ByRef TheForm As Form)
        ' Me![HEADER FORM].Form.txtHeaderName.Value = strPerson
        TheForm![HEADER FORM].Form.txtHeaderName = strPerson
    End Sub
    

    .Value is the default property and therefore not needed here, so I left it out. But it won’t hurt to add it back if you prefer.

    You can then call the procedure from the parent form, and pass the procedure a reference to itself (the parent form).

    updateHeader Me
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a form, which elements are named using a certain
I have a windows form application(c#) and an asp.NET web application which both access
Creating My Windows Form Application and using ADO.Net as Data Access layer and SQL
Am building windows form application for a Hospital using VS2010 ON ACCESS 2010. I
We have an application deployed on tomcat. To access application we are using apache
I have just started using the Data Access Application Block from microsoft. There are
I needed to create an application using Struts2 as MVC,Hibernate for data access and
I'm working on a Python server application using SQLAlchemy for database access. I would
I'm writing Playframework 2.0 application using Scala and Anorm to access db. Currently I'm
As you know anyone can access strings in an native application using a hex

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.