data retrieved form SQL to be displayed in a VBA form - TechRepublic
Question
December 26, 2007 at 06:31 PM
nadahalle

data retrieved form SQL to be displayed in a VBA form

by nadahalle . Updated 18 years, 6 months ago

Hi ,

How can i display the result of an SQL query in a sub form, i am a beginner and i have hobbled my way up to this picece of logic below.

Private Sub cmdsearch_Click()

Dim Repno As Integer
Dim strSQL As String

Repno = Me.qterrno1
strSQL = “SELECT *” & _
“FROM [TransactionsDecember2007]” & _
“WHERE (([Sales rep code]= ” & [Forms]![frmTransactionLookup]![qterrno1] & “));”

DoCmd.RunSQL (strSQL)

End Sub

what do i do to display the result of this sql on sub form.

Thank you in anticipation of your help.

Thank you
Nadahalle

This discussion is locked

All Comments