Hi Maurice,
here's my code:
Private Sub checkNaam_Click()
On Error GoTo Err_checkNaam_Click
Dim stDocName As String, stquery As String
stquery = "SELECT id, datum, perscode, sponsorkaart, voorlgast,
tussengast, achtergast, handicap, homeclub, bedrag " & _
"FROM invoer WHERE achtergast=me.achtergast "
Me.Subformulier_naamgast.Visible = True
Me.Subformulier_naamgast.SourceObject = stquery
Exit_checkNaam_Click:
Exit Sub
Err_checkNaam_Click:
MsgBox Err.Description
Resume Exit_checkNaam_Click
End Sub
thanks for helping.
rgds
Michell
> Michell,
>
[quoted text clipped - 15 lines]
> >
> > Michell van Andel
Maurice - 27 Nov 2007 18:07 GMT
Hi Michell,
Your stquery is causing the problem. You have to close the statement before
you can parametize it.
Try the following:
stquery = "SELECT id, datum, perscode, sponsorkaart, voorlgast,
tussengast, achtergast, handicap, homeclub, bedrag " & _
"FROM invoer WHERE achtergast= '" & me.achtergast "'"
after the WHERE achtergast= there is a single quote and a double quote
(enkele apostroph en dubbele aanhalingsteken) and after the me.achtergast is
a double quote, single quote and a double quote again (dus dubbele, enkele en
een dubbele aanhalingsteken).
hth

Signature
Maurice Ausum
> Hi Maurice,
>
[quoted text clipped - 44 lines]
> > >
> > > Michell van Andel