Results 1 to 5 of 5
  1. #1
    jaco123 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    2

    error 3326


    I created a query that pulls information from two forms. I then put that query on a form with a extra text boxes were you put a value in. When I press a button the following must happen. It must take the value from form 1 (payment) and it must multiply it by the text box value (rate) then it must add it to the value from form 2 (balance) my coding is as follows
    Balance = balance + ( payment * rate)
    As soon as I run the program I get error 3326. I even put it as dimensions then the code looks like this.
    Dim a,b,c as integer
    a = balance
    b= payment
    c = rate
    a = a + ( b*c)
    Balance = a
    Every thing works but as soon as I hit the last part of code I get error 3326. I know it is something stupid and something I must know but I just can't get past this code. Please showe me were I make a mistake

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,584
    Can't do running aggregate calc like this in Access form. Requires nested subquery or domain aggregate function.

    It is possible to do running calcs on report because textbox on report has a property for that.
    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
    jaco123 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    2
    Hi June 7 I didn't mention that I do the coding in the visual basic function of access

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,584
    I assumed VBA. Still think won't work and comments apply.

    But maybe need to know more about the data and query.

    If you want to provide db, follow instructions at bottom of my post.
    Last edited by June7; 01-09-2015 at 06:46 PM.
    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
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You are getting the error because the query is not updatable, meaning you can't make changes to the data in any of the fields. This often happens in queries which join multiple tables. They can sometimes be made updatable by putting indexes on all the fields used in the joins. Aggregate queries (using group by etc.) are not updatable.

    You might not need a query though - if the forms are both at the appropriate records, could you not just reference the fields directly?

    Just a note - the Dim a,b,c as integer does not define all three as integers - only c is integer. The other two are variant.
    you have to use Dim a as integer, b as integer, c as integer

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

Similar Threads

  1. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  2. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  5. Replies: 3
    Last Post: 05-02-2011, 12:08 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