It was nice of MajP to post a sample. If I had thought you actually needed it, I would have posted mine. When working for yourself, the linked tables manager has the functionality you need. There are multiple examples posted here. Feel free to search for them.
The linked tables manager handles secured BE's