Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    The Refresh Botton

    I'm able to open up any of my Forms to a new Record, great! Now I would like to know if/how after I'm finish with one Record in a Form when I hit the 'Refresh" instead of going back to the first Record I want it to go to a New Record.



    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Why are you hitting the 'Refresh' button?

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    And what 'Refresh" button are you referring to? If it's the native Access Refresh button, the answer is you can't.

    But Allan's question is really important...why do you feel the need to do a Refresh at this point in time?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Is this form in Single, Continuous, or Datasheet view?

    If the form DataEntry property is set to Yes then the form might 'refresh' to just new record. Question is, will the record just entered be committed to table? Try and let us know.
    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
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Single Form.

    I have a list box in my form which shows the 'SalesRep' name & how many vehicles they are assigned. After I've completed one form (including the salesrep) when I choose a new form that list box isn't updated unless i press Refresh. So, if 'salesrep' Ross has 10-vehicles, if i assign Ralph another vehicle when i click on a new forrm in the listbox Ralph will still be showing 10-vehicles, unles i click refresh which brings me back to Record 1. I hope this explains....?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Need code behind form to Requery the listbox. Trick is figuring out what event. Maybe the form AfterUpdate (I've never used).

    What do you mean by 'choose a new form'? Is this with the Navigation bar or command button code?
    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
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Command button code

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Then try in the button code, oh wait, maybe the form OnCurrent event:

    Me.listboxname.Requery
    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
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    When I clicked yes on the data entry property it only allowed e to view one form at a time -- not exactly what i had in mind.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    DataEntry property set to Yes means the form will open to new record only. Then the only records displayed are those entered in that session, until form is closed/reopened or requeried.

    Did you try the listbox requery code?
    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.

  11. #11
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    What is the listbox code?

    I tried my best at explaining my reasons for need hit The Refresh Botton after I input data into one Form & go to a new Form, but everyone keeps asking me why do I need to hit the Refresh botton (except you June). I'll restate my reason as I posted yesterday, [I have a list box in my form which shows the 'SalesRep' name & how many vehicles they are assigned. After I've completed one form (including the salesrep) when I choose a new form that list box isn't updated unless i press Refresh. So, if 'salesrep' Ross has 10-vehicles, if i assign Ralph another vehicle when i click on a new forrm in the listbox Ralph will still be showing 10-vehicles, unles i click refresh which brings me back to Record 1. I hope this explains....?]

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    By 'choose a new form' you mean move to a new record?

    In the form OnCurrent event, have code (use the name of your listbox):
    Me.listboxname.Requery
    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.

  13. #13
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    June,

    First, sorry for my delayed response. Second, you (I) may think that you explaining yourself clearly when to others find you quite confusing. Yes, by hitting the Refreash Botton I meant moving to a New Record within the Form; I'm sorry to have confused ppl.

    I tried:
    Me.SalesRepID.Requery \ it says that Microsoft Access cannot find the object 'Me.' Then it goes on asking about 'Me." as a Macro etc...?

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Where did you put that code? My suggestion is for VBA event. Me is a shorthand qualifier for referencing the form or report that code is behind.

    If you need to know more about programming in Access:

    http://office.microsoft.com/en-us/ac...010341717.aspx

    http://www.functionx.com/vbaccess/Lesson01.htm

    http://www.simply-access.com/Form-Events.html

    In the event on Property Sheet, select [Event Procedure] then double click the ellipses (...) and this will take you to the VBA procedure. Type code.
    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.

  15. #15
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    June,

    I followed your instructions (on the bottom): 'In the event on Property Sheet, select [Event Procedure] then double click the ellipses (...) and this will take you to the VBA procedure. Type code.

    Herre's the Code: Me.SalesRepID.Requery

    I receiverd a Compile error: Method or Date member not found

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Refresh All
    By gg80 in forum Programming
    Replies: 3
    Last Post: 01-12-2012, 03:39 PM
  2. The Refresh Button....?
    By djclntn in forum Forms
    Replies: 10
    Last Post: 01-03-2012, 05:32 PM
  3. Access 2010 Refresh VS Refresh ALL
    By Snwboarder1982 in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:07 PM
  4. Combo refresh
    By gafoor in forum Forms
    Replies: 0
    Last Post: 03-02-2011, 04:24 AM
  5. Refresh Form
    By tpcervelo in forum Forms
    Replies: 7
    Last Post: 02-07-2011, 08:03 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