Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Validation in access and in queries

Posted on 2012-04-11
1
Medium Priority
?
234 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 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

618 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