Results 1 to 3 of 3
  1. #1
    wale is offline Novice
    Windows 2K Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    1

    I need help making this statement into a code using vbscript.

    I need help making this statement into a code using vbscript.



    I need to find the amount from two tables in an access database with the following fields:
    Table Name: Base Data
    Fields/ Column title: GLAcc#, CompID, store#, Location, Amount, Month of August

    Table Name: RENT CHEQUE
    Fields/ Column title: store, NRI, MAG, %Rent

    FIRST OF ALL I NEED TO OPEN THE TABLE CALLED RENT CHEQUE
    AND THEN
    SELECT A STORE TO DETERMINE IF A SALE WAS MADE
    IF A SALE WAS MADE THEN,
    I MUST USE A FORM
    WHICH CONTAIN 2 CHECK BOXES CALLED “NRI”, %RENT” SELECT TO DETERMINE IF “NRI” OR “%RENT” WILL BE USED TO CALCULATE THE “RENT”

    THEN I MUST SELECT THE AMOUNT OR [SALE AMOUNT] e.g $7943.69 FROM THETABLE BASE DATA
    WHICH IS CORRESPONDING TO THE STORE CHOOSEN
    AND
    IF NRI IS CHECKED MARKED e.g as “yes” IN TABLE RENT CHECK
    SELECT THE NRI FIGURE IN THE BASE DATA TABLE CORRESPONDING TO THE STORE e.g.1066.00
    AND
    {MULTIPLY THE SALE MADE BY 10%}
    AND
    ADD NRI VALUE e.g. 1066.00 TO {MULTIPLY THE SALE MADE BY 10%}
    AND
    PRINT OUT THE RESULT

    I AM SO MUCH IN NEED OF A SOLUTION RIGHT NOW.
    Thank you so much in advance.!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    The amount of what? Amount?

    Just use the query builder...

    select [GLAcc#],sum([Amount]) as Total from [Base Data]

    and
    select * from [RENT CHEQUE]

    If you want particular stores to query, then you need to build a form, and build queries to read the Store off the form.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.

    Please don't shout. Typing is all caps is the equivalent of shouting.

    You should only use letters and numbers in object names. No spaces. No punctuation or special characters (underscore 0s the exception).

    I think you need to work on your table structure first.
    Is "Month of August" a field in the table? Shouldn't have month names as field names. (violates normalization rules).

    Are the tables related? On what fields?

    IF NRI IS CHECKED MARKED e.g as “yes” IN TABLE RENT CHECK
    SELECT THE NRI FIGURE IN THE BASE DATA TABLE CORRESPONDING TO THE STORE e.g.1066.00
    There is no "NRI" in the table "Base Data".

    This is very confusing.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-15-2013, 10:41 AM
  2. Making sure code runs regardless
    By nvrwrkn in forum Programming
    Replies: 2
    Last Post: 10-09-2012, 11:39 AM
  3. Need help making my code more efficient
    By themidnitereign in forum Programming
    Replies: 3
    Last Post: 08-10-2012, 11:06 AM
  4. Replies: 2
    Last Post: 06-20-2011, 09:20 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums