?
Solved

Text box with part text already

Posted on 2007-11-20
2
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 2000 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

762 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