フォームのプライベート関数で生成され、整数変数に割り当てられた値がありますが、フォームのフォーム コントロール (テキスト ボックス) に割り当てることができないようです。
フォームの一般領域でtcount を定義しました(戻り値を割り当てようとしている関数の外部からアクセスできるようにするため)。このように、別の関数呼び出しの結果を tcount に代入しています。
tcount = CountValues(Me.RecordSource,"[columnname]")
MsgBox を使用して tcount を出力していますが、見栄えがします。
テキスト領域に tcount をいくつかの方法で割り当ててみました。
Set frmname.controlname = tcount 'error - you entered an expression that has no value'
Set Me.controlname = tcount 'error - you entered an expression that has no value'
frmname.controlname = tcount 'run-time error 2448, cant assign a value to this object'
Set Form.subfrmname.controlname = tcount 'Application-defined or object-defined error'
洞察をありがとう。