Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alter a field (2000)

    I have a postcode field, which is set our like this:
    le2 1tu, but sometimes could be: le18 1tu. What I want to be able to do is to delete the sapce between the two numbers and insert a + symbol which I will then add part of a web address onto the left hand side before the le2 / le18 part and after the 1tu part

    Any ideas?

    Luke
    Best Regards,

    Luke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Alter a field (2000)

    Can you try to explain a bit more clearly what you want, perhaps with an example?

  3. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Alter a field (2000)

    Okay,

    I am trying to do the following

    We have a field called Postcode which we will type of the postcode as 'LE2 1TU' or 'LE18 1DR' etc this can be variable, there will always be three characters in the second lot ofcharacters. In the first set of characters there will be either three of four.

    Fropm that I want to to create some VBA code that send it to another field called PCodeSearch however it needs to get rid of the space and replace is with a '+' symbol. For example 'LE2+1TU'. Then

    I will add http://www.ourproperty.co.uk/search.html?refine[choice]=radius1&refine[year]=all&refine[postcode]= before the le2+1tu and add &mode=basic&tenure=&type=&x=59&y=5 after. So the full url shoud look like:

    http://www.ourproperty.co.uk/search.html?refine[choice]=radius1&refine[year]=all&refine[postcode]=le2+1tu&mode=basic&tenure=&type=&x=59&y=5

    Hope this has cleared the situation up?
    Best Regards,

    Luke

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Alter a field (2000)

    Use the replace function

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Alter a field (2000)

    You can do this in a query without using VBA. The expression would look like this:
    <code>
    "http://www.ourproperty.co.uk/search.html?refine[choice]=radius1&refine[year]=all&refine[Postcode]=" & Left([Postcode],InStr([Postcode]," ")-1) & "+" & Mid([Postcode],instr([Postcode]," ")+1) & "&mode=basic&tenure=&type=&x=59&y=5"</code>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Alter a field (2000)

    Note: user pictures are 65 pixels wide and 75 pixels high. You uploaded a picture of 75 wide by 56 high, and this is stretched to fit 65 x 75, so it shows distortion.

Posting Permissions

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