Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343

    Unanswered: Field to shrink/Grow in reports = Issue

    Hi Guys

    I've been using

    =AddressBlock([contactname],[address],[Town],[County],[Postcode])

    in a letter which is in reality a report. The text box in which this is set has the CanGrow and CanShrink set to YES.
    So when a part of the addressing fields were empty it automatically closed up the white s[pace.

    Everything in the garden until last week was rosie until the accounts dept suddenly had a "great idea" and started to place the words " No local" in empty address fields. This of course means that now I get

    Fred Bloggs
    No Local
    Anytown
    Midsection
    PT12 1AM

    Any ideas how I can make do the same process but looking for No Local and shrinking this OR something else
    I'm pretty stuck now
    Gareth

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Messy but simple way: (it might work )

    OnLoad
    if textbox.text = "no local" then
    textbox.text = ""
    report.refresh
    end if
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    Thanks George

    Ill certainly take a shot at this and see where we go


    By the way sometimes messy is good especially if it works!
    Gareth

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I've been trying to think of a more elegant solution over the last 15mins, but nothing impressive springs to mind. I'm almost certain we can get a much better way of doing this - but as you said - sometimes you just want something that you know works!
    George
    Home | Blog

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,423
    Provided Answers: 8
    what about useing the replace command

    newtxt = replace(thetxt,findthis,replaceitwith)

    so

    =replace(AddressBlock([contactname],[address],[Town],[County],[Postcode]),"no local","")

    just and idea
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    =iif(instr(AddressBlock([contactname],[address],[Town],[County],[Postcode]), "No Local") > 1, "Accounting Position Available", AddressBlock([contactname],[address],[Town],[County],[Postcode]))
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    You will want to change the code in the AddressBlock function. I would suggest possibly a SELECT statement to convert No Local and any other variations (there will be variations) of No Local to null. Then as you notice more bad data (No Locl, NoLocal, No Lo, etc.) you can just add them.

  8. #8
    Join Date
    Sep 2006
    Posts
    265
    To be quite frank the contact details are a waste of time. What is anyone going to with do this rubbish like this. To me its better to let this record go. The consequences are US Mail will reject the any mail and the user who made this enter should get a kick up the pants.

    I would not worry about the consequential effects but direct your attention to the input. If I found some-one entering this information I would report the rubbish to a superior because contact information is critical and this type of shoddy entry has no value to the business.

    Try testing "No Local" on the entry screen "Address" field or even oncurrent
    if(.[address] = "Nolocal" then
    Msgbox "Don't be such a wally"
    docmd.GotoControl "address"
    end if

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Haha, yep - go with Simon's new idea.
    He's 100% correct there!
    George
    Home | Blog

  10. #10
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    LOL OK Simon

    I wish that it was that simple - there is NOTHING I'd like more that to implement your suggestion. However, the introduction of "NO LOCALITY" is at the demand of a Government agency (yeh say no more). And also for the sheer proffessional finsh I wont let it just appear.

    So you see, come what may its "goin ta happen"....

    BY the way Thanks everyone who responded - I'll look at each options and see what I come up with

    Gareth

  11. #11
    Join Date
    Sep 2006
    Posts
    265
    I still wonder what use that information, anyone direct me to Anytown. What I would suggest is that on your Contacts you categorise them. Contacts like this are "R" Reference Only.

    On another Table - Contact Categories, along with the Contact Category, and Description and Mailing Flag. The "R" Contact Flag would be FALSE.

    Select FROM Contacts Where Contacts_Categories.[Mailing Flag] = True.

    Assume a join. Bye to Fred Bloggs of Anytown.

    Good luck.

    Simon

Posting Permissions

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