Solved

Text box with part text already

Posted on 2007-11-20
2
220 Views
Last Modified: 2013-12-26
Hi
Can anyone tell me how I can create txtboxs which already have text in it.
i.e
ATH-
I then want to add a number after the text and save this to a database.
i.e
ATH - 563892

Thanks
Andy
0
Comment
Question by:samandrew
2 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 500 total points
ID: 20323163
You can edit the .Text property at design time.  Select the textbox on the form, go into the property window and change the Text property to ATH-

You can also specify a .Text property when the form loads:
Option Explicit

Private Sub Form_Load()

    Text1.Text = "ATH-"

End Sub
 

Private Sub Command1_Click()

    Text1.Text = "ATH-563892"

End Sub

Open in new window

0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20323203
Also you can concatenate text to existing text in the text box as you do with string variables,

Text.Text = "ATH-"


then later

Text1.Text = Text1.Text & "563892"
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now