JMeister
Legacy Member
als ik mn gegevens verstuur naar mijn rapport opent het rapport leeg, doe ik een debug print dan komt alles wel terecht wat moet ik doen ?
kzou echt ni wete waar de fout ligt
heb al meermaals herdaan
mvg
kzou echt ni wete waar de fout ligt

heb al meermaals herdaan
mvg
Code:
Dim stDocName As String
stDocName = "rptFactuur"
DoCmd.OpenReport stDocName, acPreview, , , acHidden
Dim rstKlant As New ADODB.Recordset
Dim strSQLKlant As String
Dim strKlant As String
strSQLKlant = "Select KlantNaam, KlantFactuuradres, [BTW-nr] From tblKlant where KlantID= " & Forms("frmFacturatie")!txtKlant & ";"
rstKlant.Open strSQLKlant, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
With rstKlant
strKlant = !KlantNaam
Reports("rptFactuur")!txtKlantNaam = strKlant
Reports("rptFactuur")!txtKlantFactuuradres = !KlantFactuuradres
Reports("rptFactuur")!txtBTW = ![BTW-nr]
.Close
End With
DoCmd.OpenReport stDocName, acPreview
Debug.Print Reports("rptFactuur")!txtKlantNaam
Debug.Print Reports("rptFactuur")!txtKlantFactuuradres
End Sub