Question Locked

data retrieved form SQL to be displayed in a VBA form

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

This discussion is closed to new replies.