Right Syntax?

  • Thread starter Thread starter Henro
  • Start date Start date
H

Henro

Set Voorwaarde = db.OpenRecordset("SELECT Agenda.Begindatum,
Agenda.Engineer, Agenda.Omschrijving FROM Agenda WHERE
(((Agenda.Begindatum)= #" & [Forms]![Engineer]![txtVerjaardag] & "#) AND
((Agenda.Engineer)=misengineer()) AND ((Agenda.Omschrijving) Is
"Gebak!"));")


AND ((Agenda.Omschrijving) Is "Gebak!"));")

Access 2000 doesn't like the " in "Gebak!". It seems to think at the first "
that that is the endo of the instruction. What is the right syntax to use
Gebak! as criterium for Omschrijving?

Grtz Henro
 
U mean, around Gebak! ?


I will try, thnx for thinking!


MacDermott said:
You could try single quotes ' instead of double-quotes ".

HTH
- Turtle

Henro said:
Set Voorwaarde = db.OpenRecordset("SELECT Agenda.Begindatum,
Agenda.Engineer, Agenda.Omschrijving FROM Agenda WHERE
(((Agenda.Begindatum)= #" & [Forms]![Engineer]![txtVerjaardag] & "#) AND
((Agenda.Engineer)=misengineer()) AND ((Agenda.Omschrijving) Is
"Gebak!"));")


AND ((Agenda.Omschrijving) Is "Gebak!"));")

Access 2000 doesn't like the " in "Gebak!". It seems to think at the
first
"
that that is the endo of the instruction. What is the right syntax to use
Gebak! as criterium for Omschrijving?

Grtz Henro
 
I am not too certain that you are using the Is Operator correctly in the
expression???

Explain what "Agenda.Omschrijving" and "Gebak!" mean.

I assume that your (Windows) default "Short Date" format is "mm/dd/yyyy"???
 
Agenda.Omschrijving is Agenda.Description and Gebak! means Cake!

It was the date/time format: machine was set on dd/mm/yy
Using the format I changed the datverjaardag = me.txtverjaardag (verjaardag
is birthday) in datverjaardag = format([me.txtverjaardag], "mm/dd/yyyy") and
suddenly my IF statement worked! And I get cake if any of my collegues has
his birthday ;-p

Grtz Henro

Van T. Dinh said:
I am not too certain that you are using the Is Operator correctly in the
expression???

Explain what "Agenda.Omschrijving" and "Gebak!" mean.

I assume that your (Windows) default "Short Date" format is "mm/dd/yyyy"???

--
HTH
Van T. Dinh
MVP (Access)



Henro said:
Set Voorwaarde = db.OpenRecordset("SELECT Agenda.Begindatum,
Agenda.Engineer, Agenda.Omschrijving FROM Agenda WHERE
(((Agenda.Begindatum)= #" & [Forms]![Engineer]![txtVerjaardag] & "#) AND
((Agenda.Engineer)=misengineer()) AND ((Agenda.Omschrijving) Is
"Gebak!"));")


AND ((Agenda.Omschrijving) Is "Gebak!"));")

Access 2000 doesn't like the " in "Gebak!". It seems to think at the
first
"
that that is the endo of the instruction. What is the right syntax to use
Gebak! as criterium for Omschrijving?

Grtz Henro
 
Back
Top