H
Henro
I have the following code
How can I replace the #12/7/2004# with the variable Verjaardag?
[Forms].[Engineer].[Verjaardag] doesn't work although it is noted like that
in the SQL expression :-(
Private Sub Form_close()
Dim Verjaardag As Date
Dim db As Database
Dim Voorwaarde As DAO.Recordset
Verjaardag = Me.Verjaardag
Set db = CurrentDb
Set Voorwaarde = db.OpenRecordset("SELECT Agenda.Begindatum,
Agenda.Engineer, Agenda.Omschrijving FROM Agenda WHERE
(((Agenda.Begindatum)= #12/7/2004#) AND ((Agenda.Omschrijving) is Null));")
If Voorwaarde.RecordCount = 0 Then
With Me.RecordsetClone
.AddNew
!Omschrijving = "Gebak"
!Engineer = NaamEngineer()
!Begindatum = Verjaardag
![Verwerkt in agenda] = False
!Loos = True
.Update
MsgBox Msg, vbOKOnly, Titel
End With
Else: End
End If
End Sub
How can I replace the #12/7/2004# with the variable Verjaardag?
[Forms].[Engineer].[Verjaardag] doesn't work although it is noted like that
in the SQL expression :-(
Private Sub Form_close()
Dim Verjaardag As Date
Dim db As Database
Dim Voorwaarde As DAO.Recordset
Verjaardag = Me.Verjaardag
Set db = CurrentDb
Set Voorwaarde = db.OpenRecordset("SELECT Agenda.Begindatum,
Agenda.Engineer, Agenda.Omschrijving FROM Agenda WHERE
(((Agenda.Begindatum)= #12/7/2004#) AND ((Agenda.Omschrijving) is Null));")
If Voorwaarde.RecordCount = 0 Then
With Me.RecordsetClone
.AddNew
!Omschrijving = "Gebak"
!Engineer = NaamEngineer()
!Begindatum = Verjaardag
![Verwerkt in agenda] = False
!Loos = True
.Update
MsgBox Msg, vbOKOnly, Titel
End With
Else: End
End If
End Sub