473,769 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update Records Export

I am trying to figure out a way to update multiple records when a
report is exported. Each record has a "Status" field. I have a query
that selects all records with a status of "To Send" and that feeds
into a report. When the report is exported i want the status to be
changed from "To Send" to "Sent".

Any help would be appreciated.

Thanks!

Oct 29 '07 #1
3 1824
On Oct 29, 4:39 pm, Toby Gallier <azr...@gmail.c omwrote:
I am trying to figure out a way to update multiple records when a
report is exported. Each record has a "Status" field. I have a query
that selects all records with a status of "To Send" and that feeds
into a report. When the report is exported i want the status to be
changed from "To Send" to "Sent".

Any help would be appreciated.

Thanks!
It can't actually know that the report printed or exported... it only
knows that the attempt was made. If you are using a command button to
export the report, then add a line after the line that generates the
report, that updates the table.
Here is an example:

dim db as dao.database
dim sSQL_WHERE as string
set db = currentdb( )
sSQL_WHERE = " [FieldOne]=" & num1 & " [FieldTwo]=TRUE"
db.execute "UPDATE tblSomeTable SET [Printed] = TRUE WHERE " &
sSQL_WHERE

sSQL_WHERE must be set to the WHERE portion of the same query that the
report is based on with the same parameters.

Oct 29 '07 #2
"Toby Gallier" <az****@gmail.c omwrote in message
news:11******** *************@q 5g2000prf.googl egroups.com...
>I am trying to figure out a way to update multiple records when a
report is exported. Each record has a "Status" field. I have a query
that selects all records with a status of "To Send" and that feeds
into a report. When the report is exported i want the status to be
changed from "To Send" to "Sent".

Any help would be appreciated.

Thanks!
Create a procedure that performs the export, then add an update query that
changes the records from "To Send" to "Sent".

''''Sample - AirCode
Public Sub ExportReport()
DoCmd.OutputTo acOutputReport, "MyReport", acFormatSNP,
"C:\MyReport.sn p", 0
DoCmd.RunSQL "UPDATE MyTable SET [Status]='Sent' WHERE [Status]='To
Send'"
End Sub

Fred Zuckerman

Oct 29 '07 #3
There is no way for Access "know" if the export worked or the report was
printed.
When I need to confirm this type of activity, I add 2 fields to the detail
table.

ExportID Long integer
ExportC Yes / No

Before doing the report or export, I write one export ID number into all the
records selected.
Once the export or report is completed the user will use the export ID to
set ExportC to true.

"Toby Gallier" <az****@gmail.c omwrote in message
news:11******** *************@q 5g2000prf.googl egroups.com...
I am trying to figure out a way to update multiple records when a
report is exported. Each record has a "Status" field. I have a query
that selects all records with a status of "To Send" and that feeds
into a report. When the report is exported i want the status to be
changed from "To Send" to "Sent".

Any help would be appreciated.

Thanks!

Oct 30 '07 #4

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

Similar topics

3
8300
by: xMANIGHTx | last post by:
I'm new to DTS. I read some docs before adventuring into this matter. I still haven't found in all the docs I read if there is some "built-in" DTS task or function or wathever, to do a mixed "insert/update" import from a source, giving a unique field as primary key. I'll try to be more specific. The problem I would like to solve is this: I have a source file (csv) but it could be any source. I must check this file for all the records and...
1
498
by: Bridget Willey | last post by:
I am using ACT 6 and am trying to "split" the database between records for customers and junk records. The accounts designated as "customers" have that word in the ID field, and I am using that field as a lookup to separate these records from the rest of the database, which have nothing in the ID field. When I try to use the Export Wizard, it does not allow me the option to choose the lookup records to export. It seems to work, but when...
6
13143
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel spreadsheet. I'm having trouble with my code at the point at which it hits ".ReadRecords" -- the module just runs and runs without generating anything. I've gotten this code to correctly save .rpt files without any data, but not with data, nor have I been...
3
3213
by: John Graham | last post by:
I thought this would be easier, however I seem to be struggling with this. I'd like to create a command button that will look at a certain query I have created and export the records as a csv file, and also update a field called dateModified to Now(). That way the next time I run the query, it looks for null records in dateModified and only executes records that have not been processed. I've seen two approaches mentioned. ...
2
1821
by: Steve Cartnal | last post by:
I need to copy records from several different tables into one text file. Although the tables have many common fields, they also contain several that are different from table to table. I can copy and paste the dissimilar records manually into the text file, so it would seem that should be possible to do programatically. I set up export specifications for each of the twelve tables and tried to export each to the same text file. This...
4
4310
by: JHNielson | last post by:
I have a function that copies records from a table called ETL to a table called EXPORT then it exports the records in EXPORT as an excel. The record are all marked as coming from a set of data owners. What I'm trying to do now, is to filter the records that get copied into the EXPORT table by having the users choose which "DATA_OWNER" they want to export the records for. I would like to have them choose on a form which data owner they...
0
2712
by: trtaan | last post by:
Hi all, This is trtaan. I wanted to export around 300000 records that are present in my MS Access 2003 version table to excelsheet version8. I had written a code to export to multiple sheets in one workbook, but i failed to export the continous records. The code is exporting only the first 65536 records to multiple sheets. I want to find a way for this. --I tried to include an auto number field to my table but it was not successful. ...
6
4089
by: scott.tang | last post by:
I'm experiencing a very strange problem. My application is MS Access front-end and MS SQL server back-end database. I have a SQL statement that deletes records from a table after an export process. The problem is occasionally when the delete statement is executed, these records no longer display on List Box (not even in the MS Access link table). But when close and reopen the form, those records reappear. It almost like MS SQL server...
7
2889
by: emajka21 | last post by:
I have been working on creating a HR database. Everything is working fine there but now they want a training database. I basically need a few fields from the employee table and I need the full department table. I also need the position titles table along with 1 additional field. I was able to export everything fine to the new database. Is there a way to update the training database when data is updated in the HR database. I figured out...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.