473,408 Members | 2,813 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,408 software developers and data experts.

Refreshing Main Form

10
I have a form (stockcard) and I want to refresh it everytime I input addtional item from another form (stock_list). I was able to refresh the said form (stockcard) using requery on click event of stock_list form. however, the record go to the first record of stockcard form everytime i refresh this instead of the current record (the item that i have chosen from the stock_list form). what codes do i need to use in order for the stockcard form to go to the current record and not to the first record?

your help is greatly appreciated!
Dec 12 '06 #1
1 1337
missinglinq
3,532 Expert 2GB
Here's an example:

Expand|Select|Wrap|Line Numbers
  1. Private Sub RequeryAndReturnToRecord_Click()
  2. Dim ClientName As String
  3.  
  4.   ClientName = Me.CustomerName.Value  'Assigns ID to variable
  5.   Me.Requery  'Requeries form
  6.  
  7.   'Returns to record that was current when Requery was done
  8.   Set rs = Me.Recordset.Clone
  9.         rs.FindFirst "[CustomerName] = '" & ClientName & "'"
  10.         Me.Bookmark = rs.Bookmark
  11.  
  12. End Sub
CustomerName is a unique identifier for the current record. It's assigned to the variable ClientName, the form is requeried, then it's used to return to the record that was current before the requery.
Dec 12 '06 #2

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

Similar topics

1
by: sentinel | last post by:
Hello, I'm having problems refreshing a main window, and am not sure really whether the solution will be Javascript or PHP related. Firstly, I have a main file that calls a pop-up box which...
0
by: Mark Payne | last post by:
Gudday, I have an Access 2000 database which I am using as a phone directory of residents in the hostel where I work. The front end for this directory is a form with a text box (the search name...
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...
1
by: MaXXXiMaNiAc | last post by:
Hey all, I have attached here a sample of what im trying to do. Basically i set up a combo box in a subform where an employee will select his name. I want the selection to be made only once...
3
by: G25532 | last post by:
I have a form that contains a macro button which on clicking, opens a subform over the main form. I have in the macro "Where Condition" the following: =!! The subform has related fields as...
3
by: gsb58 | last post by:
Hi! A mainform is being used to show records from a table in an sql database. A button on the main form will load a new form that allows the user to add, delete, update and search certain...
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...
0
by: sean.hpr | last post by:
Hi all- I am a vb2005 newb so apologies in advance. Essentially I am having some problems with data refreshing on some of my forms. Background: I have created a project containing a few...
6
by: 130975 | last post by:
Hi Everybody, I am working on a database that creates the Student Code and their email id's. Table Student stores basic information like First name, last name, address, class etc. Table Email...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.