Solved

Text box with part text already

Posted on 2007-11-20
2
222 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

825 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