Solved

How do I requery an MS Acess Form

Posted on 2011-09-29
12
192 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
  • 6
  • 6
12 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
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
Comment Utility
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

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
ok ... but actually, why do you need to Requery ?

Can you upload the db ?

mx
0
 

Author Comment

by:shieldsco
Comment Utility
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

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
ok ... I did that ... seems to work.  Why do you need a requery?

mx
0
 

Author Comment

by:shieldsco
Comment Utility
for the dlookup
0
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!

 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Sorry ... not quite following ?

Dlookup where ?

mx
0
 

Author Comment

by:shieldsco
Comment Utility
Provider Name, Provider title, Provider EXT
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Sorry ... but where is the DLookup() ... and why would that need a Requery ?

mx
0
 

Author Comment

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

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
Comment Utility
About to suggest that!

mx
0
 

Author Closing Comment

by:shieldsco
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

728 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

11 Experts available now in Live!

Get 1:1 Help Now