Solved

How make listbox requery or refresh when go to a new or different record

Posted on 2009-05-15
4
289 Views
Last Modified: 2012-05-07
I have a form which contains a listbox.  On the form I have created a new record button.  When I click on the new record button the listbox is not refreshing or requering the data associated to the record number of the form.  The listbox is driven by a query which has criteria set to use the record number from the form itself.  What am I doing wrong?  I have tried...
    DoCmd.GoToRecord , , acNewRec
    [List24].Requery
on the onclick event of the new record button but that isn't working.
0
Comment
Question by:SteveL13
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Can you post the SQL of the query driving the list box ?

When you go to a new record ... no new record actually exists until you enter edit at least one bound control.

Does this work when you go to existing records?

What exactly do you meant by 'record number'?  The Access Auto Counter ?

mx
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
Comment Utility
Me![List24].Requery
0
 
LVL 44

Expert Comment

by:GRayL
Comment Utility
Thanks, glad to help
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
This should have worked the

 [List24].Requery

You don't have to use the Me keyword.

mx
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now