Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Justifying text in Datasheet view

Discussion in 'Information Technology' started by Mark O, Jul 28, 2006.

  1. Mark O

    Mark O
    Expand Collapse
    Guest

    Hello,

    I have the following:

    MyTable consisting of two fields and 3 records:
    ===============================================
    Field 1: MyText Text (50)
    Field 2: TextJustify Text (1)

    This is text for Record1 L
    This is text for Record2 C
    This is text for Record3 R

    MyMainForm containing MySubform.
    MySubform displays MyTable in Datasheet view.

    Problem:
    I am using a ComboBox for TextJustify to select "L"(i.e. Left),
    "C"(Center), & "R"(Right). I want to be able to change TextJustify and
    have the text in MyText respond accordingly.

    In the example above, Record1 would be Left justified, Record2 would be
    Centered, and Record3 would be Right justified.

    The Conditional Formating option on the Format menu includes Bold,
    Italic, Underline, Enable but not text justifying. Any way to do this?

    Thanks in advance.
    Mark
     
  2. Loading...

    Similar Threads Forum Date
    Malaysia Hindus, Sikhs In Malaysia Appalled With University Textbook Ridiculing Their Faiths Breaking News Jun 14, 2016
    Hard Talk Taking One Liners Out Of Context From Gurbani To Allow Intellectual Independence? Hard Talk Apr 23, 2016
    India Protests in India Over the Desecration of a Holy Text Leave Two Dead Breaking News Oct 16, 2015
    Learn Punjabi Convert Punjabi text Language, Arts & Culture Oct 11, 2013
    Sikh Coalition Harmeet Kaur Took the Lead ! First to Respond to Textbook Challenge ! Sikh Organisations May 25, 2013

  3. Michael H

    Michael H
    Expand Collapse
    Guest

    Hi Mark.

    I'm pretty sure this is not possible in a Datasheet. It should be possible
    to do in a Report, although not with Conditional Formatting. I realize
    that's not what you asked for, but just in case it would help:

    For a Report, the following (air) code could be placed in the Format event
    of the Report's Detail section:

    Select Case Me.TextJustify
    Case "L"
    Me.txtMyText.TextAlign = 1
    Case "C"
    Me.txtMyText.TextAlign = 2
    Case "R"
    Me.txtMyText.TextAlign = 3
    End Select

    In the above, I have assumed the name of the Control for the MyText Feld is
    txtMyText. Replace it with your own Control name, but give it a different
    name than the Field. Access 2000, which I'm using, makes the name of a newly
    added Control the same as the corresponding Field name, which is a bad idea.

    -Michael



    "Mark O" wrote:

    > Hello,
    >
    > I have the following:
    >
    > MyTable consisting of two fields and 3 records:
    > ===============================================
    > Field 1: MyText Text (50)
    > Field 2: TextJustify Text (1)
    >
    > This is text for Record1 L
    > This is text for Record2 C
    > This is text for Record3 R
    >
    > MyMainForm containing MySubform.
    > MySubform displays MyTable in Datasheet view.
    >
    > Problem:
    > I am using a ComboBox for TextJustify to select "L"(i.e. Left),
    > "C"(Center), & "R"(Right). I want to be able to change TextJustify and
    > have the text in MyText respond accordingly.
    >
    > In the example above, Record1 would be Left justified, Record2 would be
    > Centered, and Record3 would be Right justified.
    >
    > The Conditional Formating option on the Format menu includes Bold,
    > Italic, Underline, Enable but not text justifying. Any way to do this?
    >
    > Thanks in advance.
    > Mark
    >
     
  4. Mark O

    Mark O
    Expand Collapse
    Guest

    Thank you very much for responding, Michael.

    In my application I wanted to present 4 lines of text that will be
    printed on mailing labels. Ideally I want the user to be able to make
    the choice of formatting and see the result immediately. It looks like
    your idea will work fine on the actual printing of the labels.

    I may be able to purchase a control (an ActiveX grid) from a third party
    vendor which provides the desired functionality.

    Mark


    Michael H wrote:
    > Hi Mark.
    >
    > I'm pretty sure this is not possible in a Datasheet. It should be possible
    > to do in a Report, although not with Conditional Formatting. I realize
    > that's not what you asked for, but just in case it would help:
    >
    > For a Report, the following (air) code could be placed in the Format event
    > of the Report's Detail section:
    >
    > Select Case Me.TextJustify
    > Case "L"
    > Me.txtMyText.TextAlign = 1
    > Case "C"
    > Me.txtMyText.TextAlign = 2
    > Case "R"
    > Me.txtMyText.TextAlign = 3
    > End Select
    >
    > In the above, I have assumed the name of the Control for the MyText Feld is
    > txtMyText. Replace it with your own Control name, but give it a different
    > name than the Field. Access 2000, which I'm using, makes the name of a newly
    > added Control the same as the corresponding Field name, which is a bad idea.
    >
    > -Michael
    >
    >
    >
    > "Mark O" wrote:
    >
    >
    >>Hello,
    >>
    >>I have the following:
    >>
    >>MyTable consisting of two fields and 3 records:
    >>===============================================
    >>Field 1: MyText Text (50)
    >>Field 2: TextJustify Text (1)
    >>
    >>This is text for Record1 L
    >>This is text for Record2 C
    >>This is text for Record3 R
    >>
    >>MyMainForm containing MySubform.
    >>MySubform displays MyTable in Datasheet view.
    >>
    >>Problem:
    >>I am using a ComboBox for TextJustify to select "L"(i.e. Left),
    >>"C"(Center), & "R"(Right). I want to be able to change TextJustify and
    >>have the text in MyText respond accordingly.
    >>
    >>In the example above, Record1 would be Left justified, Record2 would be
    >>Centered, and Record3 would be Right justified.
    >>
    >>The Conditional Formating option on the Format menu includes Bold,
    >>Italic, Underline, Enable but not text justifying. Any way to do this?
    >>
    >>Thanks in advance.
    >>Mark
    >>
     
  5. Ron2006

    Ron2006
    Expand Collapse
    Guest

    If you use a Continuous Form that approximates a datasheet view, then
    the

    me.fieldname.textalign will work.

    Ron
     
  6. Mark O

    Mark O
    Expand Collapse
    Guest

    Thank you, Ron

    I'll explore the Continuous Form idea!

    Mark

    Ron2006 wrote:
    > If you use a Continuous Form that approximates a datasheet view, then
    > the
    >
    > me.fieldname.textalign will work.
    >
    > Ron
    >
     

Share This Page