Page 1 of 3 123 LastLast
Results 1 to 15 of 42
  1. #1
    Join Date
    Jul 2007
    Posts
    21

    Unanswered: Tab Functionality in Access Reports

    Appologies for the back stroy I will keep it short

    So I was thrown a curve ball recently, I was hired on as a data entry clerk at the company I work for, and since I have been tossed into the development side of things, know that I do have prior programming experience, as that is what I went to college for. Now on to my question.

    I started developing a new data module for our database, and I've completed most of the coding and SQL statements though I have run into a snag, while building my white copy of the reports I planned on using CHR(9)'s to delimit and align my data, unfotunately it seems that Access does not want to accept CHR(9)'s at all, is there a way to work around this or am I stuck with manually whitespacing each data object myself?

    lblWorksheetContainer.Caption = "Property Name:" + Chr(9) + strPropertyName + Chr(13) + Chr(10) + "Address" + Chr(9) + strAddress + Chr(10) + Chr(13) + "Test"
    Last edited by Owyn999; 07-27-07 at 15:59. Reason: Fixing Based on FAQ Suggestions

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Typically you would have several controls to do this. Two labels for address and proepry name. Aligned with the top of these, and just to the right, two or more (usually address will be 4 - 5 columns in a table) textboxes, one with the property name as the textbox and one (plus 3-4 more depending on the table structure) with the address details as the source. This allows you to move and align things in isolation. It also allows you to control their properties in isolation. For example, you would often format them differently to differentiate data from lables (some people like to keep their labels Italisised or emboldened for example).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    First thing you need to do is to drop the plus signs! In VBA they mean (gasp!) add! Concatenation is done using ampersands! To be honest, I'm not sure how Access will treat Chr(9) and Chr(10) used in this manner.

    "Property Name:" & Chr(9) & strPropertyName & Chr(13) & Chr(10) & "Address"

    Good luck!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jul 2007
    Posts
    21
    Well that didn't really change the way it was displayed changing the + signs to the &'s as I am doing this on the backend I am going to have more programming and IIRC I can have more values if I build the data struct in the Code instead of in the text field itself.

    also I have been programming in VB for years, it's just now that I've started programming in Visual Basic for Applications and this one issue, the Chr(9) non-functionality has me beating my head against the wall

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Missinglinq
    First thing you need to do is to drop the plus signs! In VBA they mean (gasp!) add! Concatenation is done using ampersands!
    Actually they do concatenate - and they have a really handy feature too (although it would be bad in this case and & is defo best).

    Code:
    ?"something" & NULL
    somthing
    ?"something" + NULL
    Null
    Last edited by pootle flump; 07-27-07 at 17:09. Reason: copy & paste error
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by Missinglinq
    To be honest, I'm not sure how Access will treat Chr(9) and Chr(10) used in this manner.
    I believe the Chr function is defined in Access to return a string based on the integer input, so I don't think it should be a problem to concatenate all the strings together. Come to think of it, I think I just wrote some code using this code not too long ago, and I believe it worked just fine.
    Me.Geek = True

  7. #7
    Join Date
    Jul 2007
    Posts
    21
    I'm still having the issue that Access isn't wanting to recorgnize my Chr(9) as a tab it just eliminates the white space is there a property for this field that I should set to allow whitespace? Also if I build the whitespace into the "" then it recognizes it IE

    Code:
    "Property Address:                     " & [PropertyAddress] & "                   Property Name:                   " & [PropertyName]
    Last edited by Owyn999; 07-27-07 at 17:13.

  8. #8
    Join Date
    May 2005
    Posts
    1,191
    Are you trying to put this string into a text box? If so, as far as I'm aware, text boxes won't take tabs. I think you may need to build your own function, using the len function to put in the right amount of " " into your string. Just a thought...
    Me.Geek = True

  9. #9
    Join Date
    Jul 2007
    Posts
    21
    Quote Originally Posted by nckdryr
    Are you trying to put this string into a text box? If so, as far as I'm aware, text boxes won't take tabs. I think you may need to build your own function, using the len function to put in the right amount of " " into your string. Just a thought...
    well I completely forgot about the LEN function so I may have to do that but I am trying to put it into an lbl box right now...

    not to sound to snarky but hence the lblWorksheetContainer.Caption

  10. #10
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by Owyn999
    well I completely forgot about the LEN function so I may have to do that but I am trying to put it into an lbl box right now...

    not to sound to snarky but hence the lblWorksheetContainer.Caption
    Sorry, forgot about that early bit of code. I don't thank a label will take tabs in Access, I'm fairly sure you're going to have to build your own "spacing" function if you're dead set on using a label.

    Else you can try using Poot's earlier suggestion, or look into using a Listbox if you want the columns to line up nicely.
    Me.Geek = True

  11. #11
    Join Date
    Jul 2007
    Posts
    21
    bah alright well we'll see what solution works properly I had hoped to make this easy and just be able to use basic fields but it looks like I'll have to try something else... maybe a list is the way to go we'll see thank you for your help thus far I'll come back when I find a solution that works well and looks right...

  12. #12
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388

    Learning on the fly

    build your own "spacing" function if you're dead set on using a label.

    Access has a function called SPACE(x) where x is the numbers to spaces that you want inserted. Instead of padding the spaces between the " " you can use SPACE(10) this will put 10 spaces between the " " . I found using this function it was easier to change the number then to keep on padding the " ".

  13. #13
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You know what?
    The best solution to this problem is here.

    Give that a thorough read and hopefully you'll see what you need to do
    George
    Home | Blog

  14. #14
    Join Date
    Jul 2007
    Posts
    21
    you know now that I read that post you are right it just took me a weekend to get my head firmly and fully out of my hind end, thank you george let me see if I can whip this report up and I'll post an image of the finished product, to be honest though, this wasn't for the property name and address it was actually for the financial data using the name and address was just a test case as I didn't have the data at the time.

  15. #15
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by Owyn999
    thank you george
    You're welcome... But Poots' should really get the praise
    George
    Home | Blog

Posting Permissions

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