Results 1 to 5 of 5
  1. #1
    superfury is offline Novice
    Windows Vista Access 2003
    Join Date
    Jun 2011
    Posts
    12

    Exclamation Calculated (vba) textbox in access form empty with value

    I have a form in access that has several textboxes with calculated values (VBA function, returns variant(always currency) value). When i open the form (and other forms that use calculated fields like this), it won't show the contents of the textbox. The textbox always has a value (either 0,00 (valuta type field) or calculated price (subtotal, BTW (taxes) and total price)).
    It starts showing the values in the textbox when it gets the focus (cursor on it/click on it) for every field, until i go to the next/previous record or close the form. When the form is closed and later reopened or gone to the next record (see onCurrent function), if the calculated field has focus when switching records/(re)opening only the field with focus shows it's value. All other calculated fields keep hiding their values until they get focus (once) again.

    Anybody knows of this problem and how to solve it (permanently)?

    BTW, i'm using windows vista 32-bit with Access 2007 on this project.

  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,816
    Don't know why this is happening. Would have to see the project to analyse if you want to provide it.
    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
    superfury is offline Novice
    Windows Vista Access 2003
    Join Date
    Jun 2011
    Posts
    12
    Quote Originally Posted by June7 View Post
    Don't know why this is happening. Would have to see the project to analyse if you want to provide it.
    I know the problem is with the settings in Access 2007, not the database. The fields are just updating like it should, but the contents (€ XXX,XX) are not visible until the field gets focus or the form gets opened (with the field having focus on open). This is until you close the form or go to a different record.

    (Just the form with VBA code is provided, rest you have to think of yourself.)
    Last edited by superfury; 07-01-2011 at 05:13 AM.

  4. #4
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    no query/tables are attached with the db to view the form...

  5. #5
    superfury is offline Novice
    Windows Vista Access 2003
    Join Date
    Jun 2011
    Posts
    12
    Quote Originally Posted by khalid View Post
    no query/tables are attached with the db to view the form...
    Tables used:

    tbl_Basistabel: Contains the basic info about the items (article number, buy/sell price, aantal=opening stock, leverancier=supply industry, gekozen (used in accounting part of the database; not supplied)).

    tbl_Leveranciers: Contains the basic info about every supplier.

    tbl_Staten: Contains the basic info about a sell or buy (depends on Soort field, 1=Sell; 2=Buy).

    tbl_Veranderingen: Contains every change in items (the sell or buy) etc. The total stock is calculated (VBA) using data from tbl_Basistabel (opening stock), tbl_Staten (information about BTW and type (buy/sell) used here) and tbl_Veranderingen (changes after start).

    tbl_Verkoopsoorten: Contains places where the sells take place (sells only, just Null (tbl_Staten) at buys).

    Supplied database with dummy data (see .zip file attached).

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

Similar Threads

  1. Calculated fields in form
    By speckytwat in forum Access
    Replies: 15
    Last Post: 04-27-2011, 05:01 PM
  2. Change controls on an empty form
    By Dom in forum Forms
    Replies: 2
    Last Post: 01-19-2011, 08:36 AM
  3. Replies: 1
    Last Post: 11-12-2010, 06:33 PM
  4. Populate or Empty Form
    By gazzieh in forum Forms
    Replies: 0
    Last Post: 12-02-2009, 05:56 AM
  5. Access 2003 returns empty recordset
    By Leelers in forum Queries
    Replies: 0
    Last Post: 03-20-2009, 11:11 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