Results 1 to 14 of 14
  1. #1
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8

    Talking Help needed to move textbox value to field in table

    Hello
    I'm trying to make an invoice form
    everything is going great so far, but i have a problem driving me crazy
    I have textbox in the subform footer of the invoice that gets the subtotal


    and a textbox in the main form that gets the value of the textbox in the sub form
    what i need is to move the value from the text box in the main form to it's field in the invoice table
    i really really need to do that ..Thanks for the help
    subform textbox name (subtot)
    mainform textbox name (invtot)
    table name (sale)
    field name (invtot)
    Thanks again

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why are you saving an aggregate value? This should be calculated when needed.
    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
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    well i need it to calculate more fields in the table , and some times i need to know the total of a specific invoice so fast you know

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You can do this but be aware the saved value has risk of becoming 'out of sync' with the raw data. How does putting value in the table help to know total of invoice? Aren't you viewing data through form or report?

    The code itself is simple:
    Me!fieldname = Me.textboxname

    The real trick is figuring out what event to put code into.
    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.

  5. #5
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    i tried to put this in the textbox afterupdate in the main form and another time in the subform..didn't work :/ ..there is tax field in the table it's calculated field (access 2010) depends on the total inv and there is a totinv after tax another field in the table

    Thanks for the help, but it didn't work..anyway to get around that ..can i use anything else to put the value of the inv total in the table ?
    Last edited by June7; 02-02-2015 at 01:13 AM.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Code is only way to save calculated data. Strongly recommend you not do this for aggregate data.

    Try the form BeforeUpdate event.
    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.

  7. #7
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    Ok thanks alot ..didn't work though , ok can you advise me how to get around that, let's say the customer not paying the total of his invoice you know what i mean

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Why didn't it work, what happened - error message, wrong results, nothing? It should work.

    Get around what? Can calculate and view invoice total on form or report. Doesn't that give you what you need? What you do with the info is something else. What do you want to happen if customer not paying total of invoice?
    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.

  9. #9
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    well nothing happening

  10. #10
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    lets say this is the table (inv number..customer..inv total..customer amount paid..customer amount need to be paid (inv total-customer amount paid),,, see the whole table is calculated fields depends on (inv total)

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Don't think I would set up db like that.

    I would have a table for customers (with CustAcctNum). Then Invoices table would be related to CustAcctNum. Then I would have a Receipts table which would also be related to CustAcctNum. Calculate difference of invoice totals and receipts totals for each CustAcctNum to determine account balance. But I've never tried to build an accounting system. I used QuickBooks.
    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.

  12. #12
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    Yeah i love quick books but it's English only so we can't use it here :/

    Here is the file
    Attached Files Attached Files

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    There is no code in the db to analyse, can't even find embedded macros. Also, can't get past the language. Don't know names of fields and controls and 3 forms. So I can't even begin to write and test any code. Sorry, not able to help.
    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.

  14. #14
    gostavee is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Posts
    8
    Alright ..Thanks for trying

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

Similar Threads

  1. Replies: 4
    Last Post: 01-21-2015, 09:34 AM
  2. Replies: 3
    Last Post: 12-11-2014, 11:26 AM
  3. Replies: 2
    Last Post: 11-19-2013, 04:35 PM
  4. move to different field when duplicate
    By Fabdav in forum Queries
    Replies: 1
    Last Post: 10-16-2011, 04:19 PM
  5. Move to next field command...
    By mvolpone in forum Forms
    Replies: 1
    Last Post: 07-06-2010, 09:30 PM

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