473,799 Members | 3,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox indent

Alireza355
86 New Member
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 11629
missinglinq
3,532 Recognized Expert Specialist
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
Alireza355
86 New Member
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 Recognized Expert Specialist
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
Alireza355
86 New Member
Yes, Yes, I do undrestand.

Thank you so much for your kind support.

Best Regards,
Alireza355
May 11 '09 #5
NeoPa
32,579 Recognized Expert Moderator MVP
FYI. The resultant data is a string value and NOT a numeric one.
May 11 '09 #6
missinglinq
3,532 Recognized Expert Specialist
That's true, NeoPa, which works out well since the data started out as a string

@Alireza355
;0)>
May 11 '09 #7
NeoPa
32,579 Recognized Expert Moderator MVP
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 New Member
@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
4148
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: http://www.2072productions.com/vim/indent/php.vim
1
5868
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 is probably correct according to the specification (text-indent is inherited), don't you think it makes no sense to apply text-indent to such elements ? Here is an example: I have a paragraph, starting with a clickable image, that's followed by...
22
27255
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
1290
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 the xsl code? ----------------------------------------------------------- Indent4ATab.xml <?xml version="1.0" encoding="GB2312"?> <?xml-stylesheet type="text/xsl" href="Indent4ATab.xsl"?> <htmlCode><!]></htmlCode>
0
1265
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 pass entry? public class myDateTextBox : AMS.TextBox.DateTextBox { protected override bool ProcessDialogKey(Keys keyData) {if (keyData >= Keys.NumPad0 && keyData <= Keys.NumPad9) {base.ProcessDialogKey(keyData); return true;
2
1907
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 pass entry? public class myDateTextBox : AMS.TextBox.DateTextBox { protected override bool ProcessDialogKey(Keys keyData) {if (keyData >= Keys.NumPad0 && keyData <= Keys.NumPad9) { return true;
2
4330
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" something like this?
2
3574
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, that text-indent is ignored. When I supply the style to a
1
1475
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 long (it is HUGE). I have written a function in a module that works perfectly in the immediate window, however when I try to call the function from the textbox, I get an error. Here is a small portion of the function (the rest will be similar...
6
6536
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. (pasting just strips out all non-hex characters). It works fine except for the fact that I can't undo after pasting into the box. I feel this must have something to do with the fact that I took over WindProc for the WM_PASTE message, but I'm not sure...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.