recordset problems

D

Denise H

Any suggestions on the best way to handle this problem?
I need to select specific records from a table (based on
user input), then update one of the fields on these
specific records (again, based on user input), then
export this 'data set' to use in a Word merge document.
I have tried many, many ways to accomplish this. I have
created the initial query and it works perfect, but I'm
assuming that I need to have this saved as a recordset so
that I can update these records, and then export the
recordset. Any suggestions on which way to go with this
would be appreciated.
Thanks,
Denise
 
D

DevalilaJohn

From your description, it sounds like you need two queries, one to update the
data and another (same query, different effect) to produce your data for
Word. If you know what records to update, you should know which ones to
include for Word.

If the user is doing multiple inputs that need to be processed as changes
prior to export, you need to either save the criteria, or maintain a temp
table where you can hold data that needs to be sent to Word.
 
G

Guest

Sorry, I guess I could have explained more. I already
have the 2 queries written (one select, one update), but
the issue then is that if you just run the update query
the user doesn't get a chance to view the records and
decide if they are correct before they update, also then
how do I save those exact same set of records to be the
ones to merge with Word. I guess what I'm really trying
to ask is how to have the recordset saved - do I maybe
have to use a temp file? I have tried various ways:

Option Compare Database
Public rsMember As ADODB.Recordset
Public cnCurrent As ADODB.Connection

Private Sub cmdNewList_Click()

Set cnCurrent = CurrentProject.Connection
Set rsMember = New ADODB.Recordset

Dim dtSentDate As Date
dtSentDate = InputBox("Enter Sent Date:")
strSQL = "UPDATE [10yrRegina] SET [Sent Date] =
dtSentDate"

MsgBox "Recordset created - Do you wish to update
Sent Date?"

rsMember.Update [SENT DATE], dtSentDate

MsgBox "Sent Date has been updated for the selected
records"
End Sub

Any suggestions? Thanks,
 
Top