473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refreshing a Form Without Going to Record One

17
I have a form with a subform, and a child linked form.

The main form is a data entry point for different business tracking. The child form that is opened from that is used to enter product information, that when closed, refreshes the main form, so that the product information appears in the subform area. (Basically populating a list)

Right now on the "close/update" button of the child form, I have code that prompts the main form to refresh. (Forms![frmName].Requery)...the problem is, I don't know how to get it to refresh the data, but to stay on the selected record. The refresh resets the record to 1, and then I have to scroll back through to my selected record.

Ideas?
Aug 10 '07 #1
4 2120
ADezii
8,834 Expert 8TB
I have a form with a subform, and a child linked form.

The main form is a data entry point for different business tracking. The child form that is opened from that is used to enter product information, that when closed, refreshes the main form, so that the product information appears in the subform area. (Basically populating a list)

Right now on the "close/update" button of the child form, I have code that prompts the main form to refresh. (Forms![frmName].Requery)...the problem is, I don't know how to get it to refresh the data, but to stay on the selected record. The refresh resets the record to 1, and then I have to scroll back through to my selected record.

Ideas?
Expand|Select|Wrap|Line Numbers
  1. Dim varBookmark As Variant   'will hold Current Bookmark
  2.  
  3. 'Store the original Bookmark in a Variant
  4. varBookmark = Me.Bookmark
  5.  
  6. 'Requery the Form
  7. Me.Requery
  8.  
  9. 'Restore the original Bookmark
  10. Me.Bookmark = varBookmark
  11.  
Aug 10 '07 #2
jclover
17
Seems to solve my problem. Thank you.
Aug 10 '07 #3
ADezii
8,834 Expert 8TB
Seems to solve my problem. Thank you.
You are very welcome.
Aug 10 '07 #4
jclover
17
Frustrating. This was working a couple of weeks back, but when I revisit the database now, it's saying that it's "not a valid bookmark".

Expand|Select|Wrap|Line Numbers
  1. 'Close the form I just entered the data into
  2. DoCmd.Close acForm, "frmMPR_Price_Subform"
  3.  
  4. Dim varBookmark As Variant
  5.  
  6. 'Store the original Bookmark of the sheet I want to requery to show the updated form
  7. varBookmark = Forms!frmMPR.Bookmark
  8.  
  9. 'Requery the Form
  10. Forms!frmMPR.Requery
  11.  
  12. 'Restore the original Bookmark
  13. Forms!frmMPR.Bookmark = varBookmark
  14.  
Then it errors out. Form resets to record 1.

Any help?
Aug 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Philo Del Middleston | last post by:
I've been searching, but apparently not phrasing my search right, so I'm going to float a question out here in the meantime... I'm wondering how to go about refreshing the content of a control...
8
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
0
by: msnews | last post by:
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my...
9
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the...
2
by: dmartin_1 | last post by:
I'm building an application with Visual Basic 2005. The application is multi threaded. It has a record counter on the form that counts up to completion. It works fine throughout the process as...
1
by: Iain | last post by:
I am attempting to create an "easy input (from the pov of the user)" form. A main form displays one page per record with a sub form displaying a list of records related to the main record. The...
5
by: chimambo | last post by:
Hi all, I have a problem with maintaining data without refreshing manually in my system. I have a system which carries data across several pages. But if a user wants to go back to the previous...
4
by: magmike | last post by:
I have a contact form that once the contact information is filled out, a button is pressed by the user to pull up another form that schedules a call back date and time for that record. If you hit...
6
by: shankari07 | last post by:
hi guys, I have a form in html which has the city drop down. when clicking the drop down a javascript is called and a file(test.txt) is created and the city is written into the file. Through php...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.