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

  • Home
  • SEARCH
  • 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 8930155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:49:19+00:00 2026-06-15T08:49:19+00:00

In my Access 2007 Form, I was previously successful in setting the controlSource of

  • 0

In my Access 2007 Form, I was previously successful in setting the controlSource of a textbox, directly in the properties window, using this code

=UCase(Left([txtLName],6) & "_" & Left([TxtFName],1))

However, in an attempt to hard-code this into the form, I’m trying to use VBA to set the controlSource property using this code:

Me.txtCodePersonal.ControlSource = "=UCase(Left([txtLName],6) & "_" & Left([TxtFName],1))"

In my debug, it address my problem to the "_" section of this line.

I don’t know how the controlSource property work in VBA, so I don’t know how to correct this.
Thank for all your help in advance.

  • 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-15T08:49:21+00:00Added an answer on June 15, 2026 at 8:49 am

    You’re attempting to assign a string value to the .ControlSource property. However, that string includes quotes within it. Similarly, in the Immediate window, this will throw an error:

    Debug.Print "=UCase(Left([txtLName],6) & "_" & Left([TxtFName],1))"
    

    Double up the quotes inside the string to avoid that problem.

    Debug.Print "=UCase(Left([txtLName],6) & ""_"" & Left([TxtFName],1))"
    =UCase(Left([txtLName],6) & "_" & Left([TxtFName],1))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code is from an Access 2007 project I've been struggling with. The actual
This is my first time building a UI in Access (using Access 2007), and
I have an Access 2007 form that is using an ActiveX Treeview control with
Is it possible to open a form in MS ACCESS 2007 using a where
I'm having a little trouble with the form filter in Access 2007. I'm using
In Microsoft Access 2007 under (Form View), how do you make text in a
I'd like to add a Browse button to an MS Access 2007 form that
I have a form created in Access 2007, but there is a need to
I have an MS Access 2007 subform that is displaying data in continuous form
I have an Access form with a textbox that is uses as an expression

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.