Solved

Text box with part text already

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

Title # Comments Views Activity
Microsoft Access combo box help 2 52
SLMGR Switches Are Not Working On KMS Host 3 146
VB6 - Convert HH:MM into Decimal 8 70
How to read File Date Created using VB6 8 63
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

730 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