Solved

How do I requery an MS Acess Form

Posted on 2011-09-29
12
234 Views
Last Modified: 2012-05-12
I have an access form that I'm requering. The requery works fine however when the action is finished the first record is displayed. How do I stay on the current record?

Private Sub ProviderName_DblClick(Cancel As Integer)
 DoCmd.OpenForm "frmService", , , , , acDialog
 DoCmd.Requery
End Sub
0
Comment
Question by:shieldsco
[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
  • 6
  • 6
12 Comments
 
LVL 75
ID: 36818926
First, because you are using acDialog ... the Requery will not happen until you Close frmService.  Is this your intent?

And actually, which form are you wanting to requery?

mx
0
 

Author Comment

by:shieldsco
ID: 36818953
Yes that's  exactly what I want.  I want to requery the main form. When I double click the the Provider Name on the main form the frmService opens and I double click on the FullNName filed which populates the Provider Name on the main form. I close the frmService and the requery runs however after completion the first record is displayed.
0
 
LVL 75
ID: 36818961
ok ... but actually, why do you need to Requery ?

Can you upload the db ?

mx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:shieldsco
ID: 36818993
Yes -- attached -- from the main menu select Sign-In and then double click on Provider Name which opens the the frmService and the user can select a Provider (Full Name)
SignIn-V1.accdb
0
 
LVL 75
ID: 36819013
ok ... I did that ... seems to work.  Why do you need a requery?

mx
0
 

Author Comment

by:shieldsco
ID: 36819062
for the dlookup
0
 
LVL 75
ID: 36819073
Sorry ... not quite following ?

Dlookup where ?

mx
0
 

Author Comment

by:shieldsco
ID: 36819091
Provider Name, Provider title, Provider EXT
0
 
LVL 75
ID: 36819157
Sorry ... but where is the DLookup() ... and why would that need a Requery ?

mx
0
 

Author Comment

by:shieldsco
ID: 36819159
I figured it  out instead of requery -- me.refresh
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 36819183
About to suggest that!

mx
0
 

Author Closing Comment

by:shieldsco
ID: 36819863
Thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

739 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