Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Location
    Thailand
    Posts
    19

    Unanswered: ... Please Help me about How to move textbox in report ...

    I want to move textbox in report automatic when preview ... ( When printed textbox has moved ... )

    How do VBA coding ?

    EX: move textbox to top 1.5 cm or move textbox to left 3 cm ...

    Help me please

    I use Access Xp sp2 Thai

    Thank you very much

  2. #2
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62
    I would put a copy of the text box in each desired location (with the same source for both boxes) and then set the text box visible property based on your criteria.


    Jack

  3. #3
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: ... Please Help me about How to move textbox in report ...

    Originally posted by Bug Corp.
    I want to move textbox in report automatic when preview ... ( When printed textbox has moved ... )

    How do VBA coding ?

    EX: move textbox to top 1.5 cm or move textbox to left 3 cm ...

    Help me please

    I use Access Xp sp2 Thai

    Thank you very much


    You can reference the textbox position using textbox left, width, top and height properties from code. If you want to do it based on a condition then one option is to open the report, with code, in design mode, set the location of the control based on the condition and then reopen in preview or print mode.

    If you go with this then:

    DoCmd.OpenReport "Name", acViewDesign
    Reports!Name!ControlName.(Left, Width etc) = "Where you want it"

    Note: The measurements are in twips. 1440 twips per inch if I remember correctly.

    DoCmd.OpenReport "Name", acViewPreview

    If you want to get your measurements beforehand then just set up the report with the textbox in both locations and record the left, top, width and height values for reference in your code.

    There are a number of methods for determining the setup of a report at runtime including the visible property mentioned by Jaash. All depends on your preferences.

    Hope this helps.

    Gregg

  4. #4
    Join Date
    Oct 2003
    Location
    Thailand
    Posts
    19
    Thx For all

    But I want to value of position textbox has negative(negative value)

    But I cant because Access cant has negative position ...

    You have other way ?

    Thx again ...

  5. #5
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by Bug Corp.
    Thx For all

    But I want to value of position textbox has negative(negative value)

    But I cant because Access cant has negative position ...

    You have other way ?

    Thx again ...
    I guess I'm not sure I understand what you are trying to accomplish. Are you trying to assign a negative value to the textbox position?

    If you want to move the text box from the current position then you can assign for instance the left property as textbox.left = textbox.left - 1000 (again this is in twips).

    See if you can reword your problem to make it clearer what you are trying to accomplish. Perhaps an example would help.

    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •