Solved

Validation in access and in queries

Posted on 2012-04-11
1
222 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
1 Comment
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
<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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now