Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Text box with part text already

Posted on 2007-11-20
2
Medium Priority
?
234 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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

810 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