Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Re: Alert about...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 30193 of 31596
Post > Topic >>

Re: Alert about existing record

by Roger <lesperancer@[EMAIL PROTECTED] > May 9, 2008 at 03:43 AM

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
 




 5 Posts in Topic:
Alert about existing record
senditontome@[EMAIL PROTE  2008-05-08 02:20:04 
Re: Alert about existing record
Roger <lesperancer@[EM  2008-05-08 02:28:17 
Re: Alert about existing record
senditontome@[EMAIL PROTE  2008-05-08 04:16:01 
Re: Alert about existing record
Roger <lesperancer@[EM  2008-05-09 03:43:17 
Re: Alert about existing record
senditontome@[EMAIL PROTE  2008-05-09 03:49:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 11:40:40 CST 2008.