Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-15
4
Medium Priority
?
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 75
ID: 24398364
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 2000 total points
ID: 24398458
Me![List24].Requery
0
 
LVL 44

Expert Comment

by:GRayL
ID: 24403409
Thanks, glad to help
0
 
LVL 75
ID: 24403479
This should have worked the

 [List24].Requery

You don't have to use the Me keyword.

mx
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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