Private Sub Inladenhuis()
Dim cnnlocatieladen As ADODB.Connection
Dim rstladen As ADODB.Recordset
Dim strCnn As String
Dim strSQL As String
Dim strProvider As String
Dim i As Long, r As Long
Dim jaarnummer As Long
i = 0
r = 0
strProvider = "Microsoft.Jet.OLEDB.4.0"
strCnn = Connectionstring & "\VermaatKelderboek.mdb"
Set cnnlocatieladen = New ADODB.Connection
cnnlocatieladen.Provider = strProvider
cnnlocatieladen.Open strCnn
Set rstladen = New ADODB.Recordset
rstladen.Open strSQL, cnnlocatieladen, adOpenForwardOnly, adLockReadOnly
[INDENT]strSQL = "SELECT tbWijn.Huis, tbWijn.type, tbWijnaantal.Aantal, tbWijnaantal.Prijs, tbWijnaantal.Wijnkoperij, tbWijnaantal.Jaartal, tbWijn.IDwijn, tbWijnaantal.Kelder, tbWijnaantal.Kelderlocatie, tbWijnaantal.Kelderlocatienummer, tbWijnaantal.jaartalbinnenkomst FROM tbWijn INNER JOIN tbWijnaantal ON tbWijn.IDwijn = tbWijnaantal.Wijnnaam WHERE (((tbWijn.Huis) Like ""*" & Me.Huisladen & "*""));"
Me.lsbWijnweergave.RowSource=strSQL
Me.lsbWijnweergave.Requery.
[/INDENT]
rstladen.Close
cnnlocatieladen.Close
Set rstladen = Nothing
Set cnnlocatieladen = Nothing
end sub