Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

validate form

Status
Not open for further replies.

slyscurry

Programmer
Aug 7, 2008
5
US
Hi,
I have a form with a subform that's a datasheet. I have one field in the parent form that equals a number (called "transactionAmount"). I have a column of numbers in the sub form data sheet. I have been able to create a new field (called "lineItemTotal") placed in the parent form footer that adds these sub form values up.
I am now trying to validate my form to make sure transactionAmount = lineItemTotal before a user clicks to a new record. If they don't equal i don't want a new record to appear, but instead a message saying "these amounts must total", or something to that extent.

Thanks!
 
GDay fella,

Consider disabling the navigation buttons and giving the user two command buttons to move back and forth through records.

In the Click logic for the buttons use an IF statement to compare the fields. If they match movenext or whatever, else msgbox("Values must equate")

 
How are ya slyscurry . . .

Have a look at the [blue]Before Update[/blue] event of a form (put the cursor on the event line and hit F1).

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
thank guys, i ended up putting a new button in the form. i appreciate the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top