By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

Adding to a recordset

P: n/a
I have a form that is open with one record in the recordset. I need to
add a record to that recordset, then requery the form. Ultimately, the
user will --from a list on another form-- one-by-one, add records to
the forms recordset. Not new records, just other existing records that
need to be displayed.

It seems like this should be pretty simple. I could have the user open
multiple instances of the form, and that would actually be a better way
for the user, but I just thought this method would be simpler to code.

Can someone point me in the right direction, I'm not asking for code,
just a tip or two. I have searced this forum a lot, to no avail.

Thanks in advance,
Jeff Smeker

Nov 13 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a

JumpinJeff wrote:
I have a form that is open with one record in the recordset. I need to add a record to that recordset, then requery the form. Ultimately, the user will --from a list on another form-- one-by-one, add records to
the forms recordset. Not new records, just other existing records that need to be displayed.

It seems like this should be pretty simple. I could have the user open multiple instances of the form, and that would actually be a better way for the user, but I just thought this method would be simpler to code.
Can someone point me in the right direction, I'm not asking for code,
just a tip or two. I have searced this forum a lot, to no avail.

Thanks in advance,
Jeff Smeker


Do all of the records come from the same table? then do something like
put a boolean field in the table and mark it True for flagged or
whatever and then filter on that. Then reset all the values in the
table to False when youclose the form. or write the ID's to a separate
table or something. Then filter on an inner join or something. Then
you'd just delete the contents of that table as necessary.

Nov 13 '05 #2

P: n/a
TJ
This may be to simple, but here is a shot. Why not just use a
me.refresh / me.requery afterupdate on the last field?

I am not sure if I answered your question or not.

Hope that helps.

Nov 13 '05 #3

P: n/a
No this wouldn't do it. Basically, the forms recordset already exists,
but I need to take that recordset, and add a record to it. This
additional record already exists, and is selected from another form.

All records (existing in the recordset, and one to be added) are from
the same table.

Any other ideas?

Nov 13 '05 #4

P: n/a
Anybody with any other ideas here?

Nov 13 '05 #5

P: n/a
"JumpinJeff" <Ju********@gmail.com> wrote in news:1108999887.212488.220650
@l41g2000cwc.googlegroups.com:
Anybody with any other ideas here?


Have you considered creating an ADODB recordset in code and setting your
form's recordset to "that" recordset?

Set c = CurrentProject.Connection
Set r = New ADODB.Recordset

With r
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
.CursorType = adOpenKeyset
.ActiveConnection = c
.Open "SELECT * FROM Table1"
End With

Set Me.Recordset = r

You can append records to this recordset and reset the form's recordset to
it.

--
Lyle
--
Nov 13 '05 #6

P: n/a
This somewhat related thread might help point out some of the issues
involved with what you are doing:

http://groups-beta.google.com/group/...23264d510bc3e1

James A. Fortune

Nov 13 '05 #7

P: n/a
This code seems to try to add a new record, when all I want to do is
just display another existing record in the current recordset. How do
you append a record to this type of recordset?

Nov 13 '05 #8

P: n/a
"JumpinJeff" <Ju********@gmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
This code seems to try to add a new record, when all I want to
do is just display another existing record in the current
recordset. How do you append a record to this type of
recordset?

You add criteria to include the additional row and rerun the query.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.