dbTalk Databases Forums  

Validating in a form object

comp.database.ms-access comp.database.ms-access


Discuss Validating in a form object in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
fred
 
Posts: n/a

Default Validating in a form object - 01-02-2004 , 06:53 PM






I'm using the following code in a validation rule on a form.

<(DlookUp("ProductSRP", "tblProducts", "ProductID =" &
[Forms]![frmPeople]![frmCases].[Form]![ProductID] & "")) *1.201

This should validate that the value entered into the current field
does no exceed the ProductSRP by more than 20%.

When I use this code I get the following Error from access:

There is a(n) " in the form control's ValidationRule property.

I've tried numerous changes to my syntax and the expression builder
but have failed to resolve it.

Can anyone point me in the right direction?

Thanks,

Fred

Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: Validating in a form object - 01-02-2004 , 08:55 PM






Fred:
If the ProductID is numeric you don't need the "".
If it is text then you need:
<(DlookUp("ProductSRP", "tblProducts", "ProductID ='" &
[Forms]![frmPeople]![frmCases].[Form]![ProductID] & "'")) *1.201
where we have added a single quote at both ends because text would
have to be:
ProductID = 'Fred'

a number would just be:

ProductID = 100

Good Luck
Ira Solomon

On 2 Jan 2004 16:53:11 -0800, fred (AT) besttechsolution (DOT) com (fred) wrote:

Quote:
I'm using the following code in a validation rule on a form.

(DlookUp("ProductSRP", "tblProducts", "ProductID =" &
[Forms]![frmPeople]![frmCases].[Form]![ProductID] & "")) *1.201

This should validate that the value entered into the current field
does no exceed the ProductSRP by more than 20%.

When I use this code I get the following Error from access:

There is a(n) " in the form control's ValidationRule property.

I've tried numerous changes to my syntax and the expression builder
but have failed to resolve it.

Can anyone point me in the right direction?

Thanks,

Fred


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.