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!

Unsaved record count

Status
Not open for further replies.

goldenlam

MIS
Feb 28, 2000
12
US
I am working on a form where I need to get an item count of data that is not yet saved.

Example:

I have two fields on the form
1. Side Item Options

sample record: "2 side dishes"

2. Available side dishes

sample records: corn, tuna, candy

When in data entry, the user has the option of selecting a SIDE ITEM OPTION, say they pick "2 side dishes".
They then go to the AVAILABLE SIDE DISHES field and can select multiple side dishes. I want to count the number of side dishes they pick so that they do not exceed the limit specified by the SIDE ITEM OPTIONS. ie, they can only pick 2 dishes. The kicker for me is that this is done prior to save.

Any help is apreciated more than words can say.

gh
 
Create a temporary variable that will hold the side dishes ordered. Try this pseudocode:

declare
side_dishes_ordered number; -- can be GLOBAL
max_allowed number := 2;
begin
side_dishes_ordered := 0;
customer orders side dishes
if side_dishes_ordered + 1 > max_allowed then
error.
else
side_dishes_ordered := side_dishes_ordered + 1;
end if;
end;

You can create the variable as GLOBAL or inside PACKAGE BODY. Just reset your variable when new order.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top