troubleshooting Question

getting a string (VBA)

Avatar of Ernest Grogg
Ernest Grogg asked on
Microsoft AccessVBA
5 Comments1 Solution111 ViewsLast Modified:

I want to get the return values for an unbound box (like a search results box):

the strWhere is where I want a query or if I can use a SQL code?

strWhere = "PersonID","qry","EntryPoint= & Form_myForm.txtGate"

(all values in the strwhere to be listed in the unbound box) BUT THE PIC DOESN'T SHOW IF I TRY TO USE A SQL:

but using a query that calls for certain information:
something like:  
strWhere = "SELECT BackgroundCheck.PersonID, BackgroundCheck.EntryPoint, FROM BackgroundCheck, WHERE BackgroundCheck.Background Is Null AND BackgroundCheck.Entry= Wisconsin Gate"


Dim strWhere As String                  'The criteria string.
strWhere= 'don't know what to put here

strSQL = "SELECT MGNameAddressPhone.PersonID, MGNameAddressPhone.FName AS [First Name], MGNameAddressPhone.LName AS [Last Name], MGNameAddressPhone.LicenseNumber AS [Licence# (W/State)], FROM MGNameAddressPhone"

    strSQL = strSQL & " WHERE " & strWhere
    Me.SearchResults.RowSource = strSQL
    Me.SearchResults = Me.SearchResults.ItemData(1)

then when a user clicks the box the result they clicked on to open a new box:

A popup opens to a form that is looking at the unbound box
Private Sub SearchResults_Click()
DoCmd.OpenForm "frmmypopup"
End Sub
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros