Results 1 to 2 of 2
  1. #1
    mrl is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    5

    Help needed with error of form/record changes

    Help! I need some text boxes on my form to update their formats/values based on the data in the 'current' record. The formatting of some of the controls is based on the values of the current record (eg a negative value will change font color to red).
    The code works fine when a new record is entered or current record is edited, so i tried putting the code into the form's event procedures (like current) which detect a change to the record - but this is causing various errors eg; "the expression you entered refers to an object that is closed or doesn't exist"...
    Where should i should be placing the code/event procedure so it works?

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    In virtually every one of my bound form modules I create a "SetControlProperties" sub procedure. This routine I call from the form OnCurrent and certain control AfterUpdate event procedures. It is a good idea to place your formatting code in such a sub procedure so you don't have to duplicate your code in different places.

    Regarding your error, what line of code is highlighted when you get the error?

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

Similar Threads

  1. Replies: 3
    Last Post: 08-31-2011, 09:37 AM
  2. On error go to advice needed
    By AndycompanyZ in forum Programming
    Replies: 6
    Last Post: 06-24-2011, 04:49 AM
  3. adding new blank record help needed
    By Mile129 in forum Forms
    Replies: 2
    Last Post: 09-22-2010, 08:49 AM
  4. Filter by Form error on 1,000th record?
    By Freybourne in forum Forms
    Replies: 0
    Last Post: 06-20-2010, 05:48 AM
  5. Replies: 1
    Last Post: 03-09-2009, 12:46 PM

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