If you simply want to find rows in B which contain the AID value as a substring within the BID column in B then you can use the LIKE operator to join the tables:
SELECT b.*
FROM a INNER JOIN b
ON b.bid LIKE "" & a.aid & "";
However, this might produce specious substring matches. If the ID value in BID is separate 'word' in the string, i.e. it is separated from rest of the string by spaces, punctuation characters etc. then you might like to take a look at FindWord.zip in my public databases folder at:
https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
This little demo file illustrates the use of a FindWord function, and uses the text of T S Eliot's poem The Wasteland as its example. If I add a table named Words with the values summer, Marie, and bridge in a single column named Word, the following query using the LIKE operator
SELECT Wasteland.*
FROM Wasteland INNER JOIN Words
ON Wasteland.LineText LIKE "" & Words.Word & "";
returns 6 matching rows:
Summer surprised us, coming over the Starnbergerse
And I was frightened. He said, Marie,
Marie, hold on tight. And down we went.
A crowd flowed over London Bridge, so many,
Or other testimony of summer nights. The nymphs are
London Bridge is falling down falling down falling
The following query calling the FindWord function returns the same 6 rows:
SELECT Wasteland.*
FROM Wasteland INNER JOIN Words
ON FindWord(Wasteland.LineText,Words.Word);
So, in this case the LIKE operator works correctly, with no specious matches, but the second query is still a safer option.