Results 1 to 3 of 3
  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    Sum one filed based on its contsest

    Hello everybody,

    I have a large table called nanfinal which consists 7 fileds:code,name, trns#,gross$,net$,commis$ and date. I created the form(frmnaninvoice) which has 5 text boxes. I need to calculated the total goss$ based on code in code filed, f.e if codes are 003 and 010 so text box named txtNSF would be populated by sum of gross where codes are 003 and 010 in code field. The break up like this :
    code 003,010 txtNSF
    Code 001,008,011 txtGross
    Code 007,009 txtcost
    Code 002 txtDirect
    I placed a text box called textDate and put reference of it onto a query of the table nanfinal and placed a command button cmdadd so once user types date and click command button the adding sum will show up in corresponding text boxes accordingly the codes and date.
    I need a help how to confugurate vb code into command button.

    Thank you in advacne for help,

    The Best Regards.

    Boris

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Could use a Select Case structure in the Click event of the command button.

    Review http://msdn.microsoft.com/en-us/libr...(v=VS.80).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thnak you ,

    That helped,

    BorisGomel

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

Similar Threads

  1. Replies: 7
    Last Post: 02-10-2012, 08:08 PM
  2. Query: Two tables With Yes/No Filed
    By Judasdac in forum Queries
    Replies: 6
    Last Post: 10-17-2011, 12:24 AM
  3. Replies: 2
    Last Post: 11-15-2010, 03:57 PM
  4. Replies: 1
    Last Post: 11-05-2010, 05:49 PM
  5. Sum of a categorized filed
    By Costa in forum Reports
    Replies: 0
    Last Post: 02-24-2010, 07:34 AM

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