Since a function can return a value (where a sub cannot) your function needs to result in a return value to something. Thus
Function MyFunction () AS SOME TYPE or
Public Function MembYear() As String
If you need to pass parameters to the function, they go inside the ()
In design view, you can "grab" every control that will call the function and enter = MembYear(), probably in any event you want, and do them en masse. I've only done this for command button click events so far, but can't imagine why you couldn't use the method. I see you trying this on the textbox control and assigning the function to its recordsource (control has to be unbound). I'd say you're correct - has to be a control.
Thread title doesn't seem to reflect a general question as opposed to a specific one, but I'll post a link that may help understand scope if you need that.
https://bytes.com/topic/access/insig...-vba-ms-access
In your example, you've neglected to set the return value of the function so that the control can receive it:
MembYear = BegString & " - " & EndString ' (which is "2018 - 2019")
You don't necessarily need a variable as well.
Last edited by Micron; 01-25-2019 at 05:29 PM.
Reason: code correction
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.