I have a module with a procedure inside that looks like this:
Public Sub OpenRecordset() Dim qdf As QueryDef Set qdf = CurrentDb.QueryDefs("QOff2") qdf.Parameters(0).Value = [Forms]![Form]![Text10] Dim db As Database Dim rs As Recordset Dim StrBusinesses As String Set rs = qdf.OpenRecordset If rs.EOF And rs.BOF Then MsgBox ("No businesses exist for this Customer") Exit Sub Else rs.MoveFirst End If StrBusinesses = "" Do While Not rs.EOF StrBusinesses = StrBusinesses & rs!Fnam & ", " rs.MoveNext Loop rs.Close StrBusinesses = Left(StrBusinesses, Len(StrBusinesses) - 2) Forms!Form.Badge = StrBusinesses Set rs = Nothing End Sub
I am trying to get this module to input the query results into a textbox (forms!form.badge), but I can't seem to get it to do it like my 5 other dlookup functions. When I open up the module and push the green play button, it shows up on the correct textbox but also shows up on the other records as well. It also doesn't show up automatically, nor does it update as you enter in the parameters. Isn't a module supposed to help autofil numerous variables into a text box in place of dlookup for multiple values?