Results 1 to 2 of 2
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    Using DoCmd Alight Right to align text in a textbox

    On my form, I have a field called 'email.' I want to click a button and alight the text in the 'email' text box to the right.

    Code:
    Private Sub cmdDoCmd_Click()
        Email = DoCmd.RunCommand  acCmdAlignRight
    End Sub
    I am getting a 'syntax error.' What am I doing wrong? I am new to Access. What is the syntax for referring to controls on a form?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You can access the text allign properties like this

    Me.Email.TextAlign = 1

    You can see more info in the help files under, "TextBox.TextAlign Property"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 03-12-2013, 01:41 PM
  2. Align text in a field column.
    By israellawndale in forum Access
    Replies: 1
    Last Post: 08-16-2011, 06:18 PM
  3. Export to Text File Using DoCmd Access 2007
    By tonere in forum Programming
    Replies: 1
    Last Post: 03-30-2011, 06:14 PM
  4. How to vertically align text inside a text box ?
    By alexcalgary in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 08:44 AM
  5. Replies: 2
    Last Post: 12-19-2005, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums