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

Adding to a recordset

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
8 2070

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
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
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
Anybody with any other ideas here?

Nov 13 '05 #5
"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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve Z | last post by:
Some guidance por favor I started this program with the Data Form Wizard (never again). I'm pretty deep into it now, this piece of code keeps overwriting the first record in the DB: Private Sub...
1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
2
by: Robin S. | last post by:
This is an "Add product" form. The user will enter a ProductNo (catalog number), select a Product Class (from cascading combo boxes) and then click a button to create the product. When a...
4
by: ghanley | last post by:
Hi Guys, I need some help with a problem related to the looping through a recordset to display on a tree view control. My table has no Primary key - because duplicates are allowed. ID ...
14
by: Karl Irvin | last post by:
While adding data to a record set, I use something like rst! = some variable rst! = some variable ...... rst! = some variable The rst! , rst! etc. are manually typed in and it gets...
5
by: joe donnelly | last post by:
I have a couple of questions about recordsets: 1. When a recordset is summoned by the code where does it actually exist and in what form...is it created in the database (data source location)...
1
damonreid
by: damonreid | last post by:
Access 2003 Microsoft Windows XP Pro Hey, I am currently pulling my hair out here. I have a Form for adding new projects to a database, the only problem is that when I close the form it doesn't...
4
by: jaz215 | last post by:
hi! how do i add a record in a database without using the datacontrol and adodc. i want to rework my code to using purely codes and not being dependent on the design on vb. so far i have. Set rs...
18
omerbutt
by: omerbutt | last post by:
AJAX PROB WITH MULTIPLE RECORDS helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
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...

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.