Share via

MID/FIND function in Access

Anonymous
2011-02-23T10:03:54+00:00

In Excel you can combine the MID and FIND function to select text up to a character eg " or & .  Is there a similar function in Access?  I can see MID, LEFT and RIGHT but not an equivalent to FIND.  I want to populate a new field with text from the start of a field to the first space - I would rather not have to take the data into Excel and then back into Access if it's not necessary.

Thanks!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-02-23T11:04:01+00:00

Hi Tonia

This is untested. You would need to change <NameOfField> the name of the field/control that has the text.

Left("NameOfField", InStr(1, "NameOfField"," ",vbTextCompare))


Hope this helps Bob Fitz BizSoftware If this answer solves your problem, please check, Mark as Answered. If this answer helps, please click the Vote as Helpful button.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-02-23T10:59:21+00:00

    I will give that a go!  Many thanks

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-02-23T10:47:06+00:00

    I believe you are looking for the InStr() function.

    InStr ( [start_pos], string_to_search, search_string, [compare_mode])

    MS Access: InStr Function

    http://www.techonthenet.com/access/functions/string/instr.php

    Note: If you use an optional compare_mode constant, you should supply a start_pos as well.


    • "Have you tried turning it off and then on again?" - Roy from 'The IT Crowd' (Emmy award-winning British comedy)

    Was this answer helpful?

    0 comments No comments