Solved

Validation in access and in queries

Posted on 2012-04-11
1
228 Views
Last Modified: 2012-11-04
i need to make  a validation during enter data in table or form , the validation is that the amount in field is not exceeding the corosponding value in queries , and hoe to define the relation that lead to this corrsopnding data , ie table contain po and in the form i need to enter the recieving related to the po but not to exceed the original po amount
0
Comment
Question by:mmously
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 37832936
<i need to make  a validation during enter data in table or form>

do the validation using a form..

use the beforeupdate of the form or the control (textbox) where you enter the data.

private sub controlName_beforeupdate(cancel as integer)
' verify the amount

if me.controlName > dlookup("originalamount", "tableName", "[po]=" & me.txtPo) then
   msgbox "Amount is greater than original amount"
   cancel=true
  exit sub
end if


end sub
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question