On May 8, 5:16=A0am, senditont...@[EMAIL PROTECTED]
wrote:
> Hi Roger,
>
> As I'm still very much on the learning curve, I'm not too sure where I
> put the word 'Where' in the code. I used the code you suggested
> without a 'Where' and it came back with the message;_
>
> Syntax error (missing operator) in query expression '****ft =3D Late'
>
> Also, would it be better if the text boxes were renamed txtDatum and
> Txt****ft as opposed to Datum and ****ft after the fields they
> represent?
>
> Much appreciated.
>
> Yvonne
if you put the cursor over the word 'dcount' and hit f1 for help,
you'll see that this function takes up to three parameters and the
third is a 'where' expression
since the ****ft field is textual it needs to be surrounded by single
quotes, your code should look like
If DCount("Datum","QryAlertExisting", "****ft =3D 'Late'")<1 Then
DoCmd.OpenForm "FrmAddNewRe****t"
Else
MsgBox "A re****t already exists for that ****ft on that Date""
End if
that is double-quote ****ft equal single-quote late single-quote double-
quote
as to renaming text boxes, it's a matter of preference.. I like the
text box name to match the field name so that I don't need to do
mental translation when working with vba


|