473,322 Members | 1,778 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,322 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 2118
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.