473,395 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Textbox indent

Alireza355
Dear all,

Is there a way to have a little indentation in a textbox in a subform in datasheet view?

I tried this:

=" " & [MyField]

in the recordsource, but I keep getting an error.
May 10 '09 #1
8 11561
missinglinq
3,532 Expert 2GB
You put it where? A form or report has a Record Source, not a textbox. A textbox has a Control Source but placing such code there will prevent the textbox from being bound to the underlying table/query, if that is needed. Something like this will do the job, but if you do any type of data manipulation, such as searching for strings, you need to keep in mind that the data has the string of spaces in front:

Expand|Select|Wrap|Line Numbers
  1. Private Sub MyField_AfterUpdate()
  2.   Me.MyField = "  " & Me.MyField
  3. End Sub
Linq ;0)>
May 10 '09 #2
Thank you for your kind reply.

Sorry about mis-spelling Control Source. I tried your code, but not yet getting the results I need.

Let me explain a bit more. I have a form with a subform in it. The subform is always displayed in Datasheet View. In one of the columns (fields) I want the text to have a little indentation. I don't think After Update would be appropriate for what I want to do, because the subform is not editable. It just shows some information from a table.

Thank you so much, and waiting for your support.
May 11 '09 #3
missinglinq
3,532 Expert 2GB
Alireza355, the people on this forum who answer questions are all volunteering their time.You need to understand that in order to
  • Not waste their time
  • Facilitate their helping you
you really need to "explain a bit more" in your original post, not after someone has taken the time to answer your question.

Given this new information, the form your subform is based on will need to have a Query as its Record Source. If it is currently based on a Query, you'll need to add a calculated field, by entering something like this in a new, blank field in the Query Design Grid:

FormatMyField: " " & [MyField]

If the form is currently based on a Table, you'll need to create a Query from the Table, including all the fields, then add the calculated field as shown above. You can easily do this using the Query Wizard if need be.

If the form was originally based directly on the Table, go into Design View for the form and change the Record Source from the Table to your newly created Query.

In either case, you now need to select the textbox and go into Properties - Data and change the Control Source from MyField to FormatMyField.

The textbox will now display with your spaces in front of the data.

Linq ;0)>.
May 11 '09 #4
Yes, Yes, I do undrestand.

Thank you so much for your kind support.

Best Regards,
Alireza355
May 11 '09 #5
NeoPa
32,556 Expert Mod 16PB
FYI. The resultant data is a string value and NOT a numeric one.
May 11 '09 #6
missinglinq
3,532 Expert 2GB
That's true, NeoPa, which works out well since the data started out as a string

@Alireza355
;0)>
May 11 '09 #7
NeoPa
32,556 Expert Mod 16PB
That may be true Linq, but there are other ways that could be interpreted in the circumstances.

I'm very careful what conclusions I jump to - especially when dealing with members whose first language is not English (I don't include you Yanks in that btw ;D).
May 11 '09 #8
Freddyboy
2 2Bits
@NeoPa
open your subform in a new window. It should show you form view. under 'properties' for the field you want, change the margin to your desired indent.
Feb 19 '22 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: John Wellesz | last post by:
If you are coding php using GVIM, you will appreciate this new indent script: Download there: http://www.vim.org/scripts/download_script.php?src_id=3710 or here: ...
1
by: Vincent | last post by:
I noticed an irritating behaviour of the text-indent property and I wonder if I'm the only one to feel this way about it: it seems that text-indent applies even to floated elements. Although this...
22
by: Firas | last post by:
Hi, Is there a CSSish way to indent a paragraph except for the first line? I tried p:first-line { text-indent: 0em; }
0
by: saabi | last post by:
How to indent length 4 a tab in IE? The text in this CDATA was some html code, it would indent length 8 a tab in IE, but I like to indent length 4 like in the original html editor, How to change...
0
by: EgoSum | last post by:
Can someone help me with custom text box? I want change behavior custom date text box - disallow entry and pass entry from numeric keyboard to a text box. Code below disallow entry, but how I can...
2
by: EgoSum | last post by:
Can someone help me with custom text box? I want change behavior custom date text box - disallow entry and pass entry from numeric keyboard to a text box. Code below disallow entry, but how I can...
2
by: Benny | last post by:
Is there a way to trace exceptions and messages captured with the Enterprise Library to a custom destination like a text box or any other control? If not can anyone think of a way to "hack"...
2
by: Chris Seidel | last post by:
Hi, I have a submit-element with a background-image of 16x16 px and the following style: background-image: url("ok.gif"); background-repeat: no-repeat; text-indent: 20 px; The problem is,...
1
by: lmj24 | last post by:
Hi, I am using MSAccess 2002 Windows 2000 (stop laughing!) I am trying to use a function to generate a string in a textbox on a form. I can't use expression builder because the expression is too...
6
by: xenocidecrash | last post by:
I am using: C#, .Net, Windows Forms I have created a derived class from the System.Windows.Forms.TextBox class that only allows hexadecimal characters to be entered, whether typed or pasted....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.