Results 1 to 5 of 5
  1. #1
    accessnewb is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York, NY
    Posts
    116

    DisplayRecordset

    I have disabled the default navigation buttons for a form and instead created a textbox to display the number of records. This is the expression I have entered in the control source of the textbox:



    ="Record " & [CurrentRecord] & " of " & Count([SNo]) & ""

    Now the problem is the textbox doesn't get automatically updated when I enter a new record. For example, if I currently have 20 records, and I am on the last record, it correctly shows "Record 20 of 20". But if I add a new record, then it shows "Record 21 of 20". I have to manually refresh the page for the record to get updated. Any way for the form to automatically refresh?

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Do a Me.txtBoxName.Requery on one of the events of whatever you use to add a record. That should refresh the textbox everytime you add/change/delete a record

  3. #3
    accessnewb is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York, NY
    Posts
    116
    But I can't do a me.txtboxName.requery in the control source of the textbox . So I should write the code in an event. Do I write it in the beforeUpdate or the afterUpdate event?

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    You would write it in the AfterUpdate or OnChange events of whatever it is you use to create a record.

  5. #5
    accessnewb is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York, NY
    Posts
    116
    umm, it still does not work! I added a new record and it still shows "Record 31 of 30"

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

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