How can give following restriction in my form ?

How can give following restriction in my form ?

Hello Respected Members, 

I am in problem and i want to solution of it, first i am described my whole application and then i am tell you my problem.

I have a application which name is "VIP ZONE" it has two forms first is "VIP REGISTRATION" and another is "DEMAND FORM".
My first form "VIP REGISTRATION" this is like as a registration form,this form have following fields :
USER NAME - string type
VIP_ID - string type
Your Email ID- email type
VIP Membership Type - Drop-down list (pick-list)
this Drop-down list(VIP Membership Type) have following option- "7 Days", "15 Days", "30 Days", "180 Days", "365 Days". user select one option in these option on registration time.
when USER registered on this form then he type his name in USER NAME then type VIP ID and his Email ID and in the VIP MEMBERSHIP TYPE they are choose a option from above.
So now USERS successful registered.
-----------------------------------------------------------------------------------------------------------------
My Another form is "Demand Form" it is like as Login form, it have following fields:
USER NAME -string type
VIP_ID - string type
Your Email_ID - Email type
Today's Date - Date field which is load automatically with zoho current date
VIP Membership Type- Drop down list Options-  "7 Days", "15 Days", "30 Days", "180 Days", "365 Days"

by this form USER give his Demand to me now this field is based on "VIP REGISTRATION" form, the users which are registered on "VIP REGISTRATION" form can give Demand by this "DEMAND FORM"

it checks the USER NAME, VIP-ID, and Email ID from "VIP REGISTRATION" form and then automatically fill the value of VIP MEMBERSHIP Type; which is filled on Registration time.

-----------------------------------------------------------------------------------------------------------
Now i am give a restriction that USER which is select "7 Days", "15 Days" or "30 Days" can give only one demand in 24 hours(1 day). means they can give only two demands/day. and USER which is select "180 Days" or "365 Days" can give only one demand in a day then he can give his demand in next day when "Today's Date" field is changed.
For example a user which have "7 days" VIP Membership type then he can submit the Demand form in  two times
in 24 hour after this he get the error message and his submit is cancel. now he can submit after 24 hours when the "Today's Date" field is changed.

So please tell me how can i do that.
 however i will try this following code in Form validation of Demand form but it is not working for me.
----------------------------------------------------------------------------------------------------------------------------------------------------------
if (count(VIP_REGISTRATION[((USER_NAME == input.USER_NAME && VIP_ID == input.VIP_ID) && Your_Email_ID == input.Your_Email_ID)])  ==  0)
{
    alert ("Your USER NAME, VIP_ID and Email_ID are not match, Please try again or Contact to our Administration. ");
    cancel submit;
}

else
{
    temp  =  DEMAND_FORM  [((USER_NAME == input.USER_NAME && Your_Email_ID == input.Your_Email_ID) && VIP_ID == input.VIP_ID)];
    if (temp.VIP_MEMBERSHIP_Type  ==  "7 Days")
    {
        if (count(DEMAND_FORM[Today_s_Date == input.Today_s_Date])  >  2)
        {
            alert "You reached your Per Day demands, now you can't give another demand.Please try again in next 24 hours.";
            cancel submit;
        }
    }
    if (temp.VIP_MEMBERSHIP_Type  ==  "15 Days")
    {
        if (count(DEMAND_FORM[Today_s_Date == input.Today_s_Date])  >  2)
        {
            alert "You reached your Per Day demands, now you can't give another demand.Please try again in next 24 hours.";
            cancel submit;
        }
    }
    if (temp.VIP_MEMBERSHIP_Type  ==  "30 Days")
    {
        if (count(DEMAND_FORM[Today_s_Date == input.Today_s_Date])  >  2)
        {
            alert "You reached your Per Day demands, now you can't give another demand.Please try again in next 24 hours.";
            cancel submit;
        }
    }
    if (temp.VIP_MEMBERSHIP_Type  ==  "180 Days")
    {
        if (count(DEMAND_FORM[Today_s_Date == input.Today_s_Date])  >  1)
        {
            alert "You reached your Per Day demands, now you can't give another demand.Please try again in next 24 hours.";
            cancel submit;
        }
    }
    if (temp.VIP_MEMBERSHIP_Type  ==  "365 Days")
    {
        if (count(DEMAND_FORM[Today_s_Date == input.Today_s_Date])  >  1)
        {
            alert "You reached your Per Day demands, now you can't give another demand.Please try again in next 24 hours.";
            cancel submit;
        }
    }
}
----------------------------------------------------------------------------------------------------------------------------------------------

Please help me I am waiting a response 

Thanks in advance

Regards
NP