Solved

How do I requery an MS Acess Form

Posted on 2011-09-29
12
243 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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

Technology Partners: 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!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

717 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