473,390 Members | 1,406 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,390 software developers and data experts.

Resetting the Recordset while within the Form - how?

I might not have phrased the question correctly in the Subject of this
post. Please read the entire explanation.

I have a form with a command button (Add New Person). This button opens
up another form (frmPeople) with a NewRecord (blank fields). The
frmPeople form has a command button to save the record. I call this
scenario ADD Mode. When the record is saved we stay in ADD Mode and get
another NewRecord.

This form (frmPeople) may, also, be entered by selecting a person's name
from a combobox. This opens up frmPeople with the entire recordset
available and positioned at the selected person. I call this BROWSE
Mode. All fields are protected until the user hits the EDIT command
button.

I want to change this a bit. After the NewRecord is saved, instead of
staying in ADD Mode, I want to go into BROWSE Mode and have all records
available. I want to be positioned at the newly saved record.

I thought that I could use the Requery method on the form (me.Requery)
to pull in all records based on the RecordSource already defined in the
form's attributes. That doesn't seem to work, because when I code the
following after the Requery ...

'Position current record to the record just saved
Set db = CurrentDb
Set rs = Me.RecordsetClone
rs.FindFirst "[peopleID] = " & lngPID
Me.Bookmark = rs.Bookmark

it fails on the "me.bookmark = rs.bookmark" instruction with "No current
record" error.

Does anyone have any suggestions?

- SueB

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
3 3108
Susan Bricker <sl*****@verizon.net> wrote in
news:9l**************@news.uswest.net:
I might not have phrased the question correctly in the Subject
of this post. Please read the entire explanation.

I thought that I could use the Requery method on the form
(me.Requery) to pull in all records based on the RecordSource
already defined in the form's attributes. That doesn't seem
to work,
Does anyone have any suggestions?


If your frmPeople is still in data entry mode, e.g. the data entry
property is true, requerying the form won't help. You need to set
it to false, then requery. Start by checking that.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #2
"Bob Quintal" <rq******@sympatico.ca> wrote
If your frmPeople is still in data entry mode, e.g. the data entry
property is true, requerying the form won't help. You need to set
it to false, then requery. Start by checking that.


And, the Bookmark is invalidated when you requery, so you need to do a Find
on the unique identifier of the just-added Record, and use the _new_
Bookmark.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #3
Bob,

It's a miracle. Ok ... maybe not a miracle but I'm thrilled to tell you
that IT WORKED. Thanks so much.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
1
by: timchalk | last post by:
I believe I've found a problem with the Safari DOM when updating the text found within a layer. Although the layer is updated correctly visually, the underlying DOM seems to grow larger with...
2
by: ano1optimist | last post by:
I have a form with a search button. I'm using command parameters to pass search criteria to a stored procedure. Here is my code: Stored procedure: CREATE PROCEDURE . @strCriteria varchar(200)...
4
by: MNC | last post by:
I'm using Access2002, and can't seem to get an updateable recordset going :-( What am I doing wrong, here's the code. The form's controls are not locked, the recordset type is Dynaset (changing...
8
by: lauren quantrell | last post by:
When I open an Access form I can have no recordset specified, then in the form's OnOpen event I can do something like: Me.paramaters = "@SomeColumn = 22)" Me.recordsource = "dbo.sproc123" But I...
8
by: LabGeek | last post by:
Do I have to recreate a recordset everytime I want to use it, or can I simply create a recordset on the form open event and access it for the life of the form? I guess my question is really what...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
4
by: phill86 | last post by:
Hi, Bare with me this is going to take some explaining and any help is much appreciated I have a form that stores details of sessions which include start/end date start/end time these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.