Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Solved: VBA Code to Differentiate New Data from Old Data


(!)

axkoam's Avatar
axkoam axkoam is offline
Member with 22 posts.
THREAD STARTER
 
Join Date: Jun 2012
Experience: Beginner
03-Jul-2012, 05:17 PM #1
Solved: VBA Code to Differentiate New Data from Old Data
Windows 7, Microsoft Access 2007, VBA

I have a routine I've put together where I send out a bunch of records to the email address that's in one of the fields in each record. Some records don't have emails yet (null field) so I made a form for a user to enter the email into that field.

These records are orders, and when they come in, I'd like to immediately email the records that do have an email and then once the user enters the email addresses for the others, send them out too.

As of now, I can't figure out how to only send out the records with newly recorded email addresses. Right now my script would send the records that had email addresses in the first place out twice (once initially, and then again once the user enters in the null emails and clicks send).

What would be an approach to just having the records that haven't been sent yet, get sent?
Rollin_Again's Avatar
Member with 4,686 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Advanced
03-Jul-2012, 09:36 PM #2
Add a column to the table containing the order information and use a boolean value (True / False) to flag the record as having had an email sent already. You just change the logic in your script to send emails for only those records where the flag is set to False.

Regards,
Rollin
axkoam's Avatar
axkoam axkoam is offline
Member with 22 posts.
THREAD STARTER
 
Join Date: Jun 2012
Experience: Beginner
05-Jul-2012, 12:16 PM #3
Thanks, problem solved.
I used a SQL update statement to set the value of the yes/no field, for anyone following.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑