|
-
Sep 13th, 2005, 05:41 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] After email sent update recordset feild
How do I update the strEmailsent feild after an email is sent?
VB Code:
DoCmd.SendObject , , acFormatTXT, stEmailAddress3 & ";" & stEmailAddress, stEmailAddress4 & ";" & stEmailAddress2, , stSubject, stText, -1
rs!strEmailsent = True ' --this is a YES/NO checkbox feild
rs.MoveNext
-
Sep 13th, 2005, 05:47 AM
#2
Re: After email sent update recordset feild
-
Sep 13th, 2005, 06:46 AM
#3
Thread Starter
Hyperactive Member
Re: After email sent update recordset feild
Not working. Error Saying Update or Cancel update without Addnew or Edit
-
Sep 13th, 2005, 06:49 AM
#4
Re: After email sent update recordset feild
 Originally Posted by vonoventwin
Not working. Error Saying Update or Cancel update without Addnew or Edit
Then you need to do an AddNew or an Edit on the recordset.
Is this VB or VBA?
-
Sep 13th, 2005, 08:59 AM
#5
Re: After email sent update recordset feild
If it is a DAO recordset, you need to add rs.Edit before you change the value, and rs.Update afterwards.
If it is an ADO recordset you don't need the rs.Edit, but you still need the rs.Update.
-
Sep 13th, 2005, 11:04 AM
#6
Re: After email sent update recordset feild
Moved to Office Development forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 13th, 2005, 11:10 AM
#7
Thread Starter
Hyperactive Member
Re: After email sent update recordset feild
Hmm I am lost...
VB Code:
DoCmd.SendObject , , acFormatTXT, stEmailAddress3 & ";" & stEmailAddress, stEmailAddress4 & ";" & stEmailAddress2, , stSubject, stText, -1
rs.Edit strEmailsent = -1
rs.Update strEmailsent
rs.MoveNext
-
Sep 13th, 2005, 12:29 PM
#8
Frenzied Member
Re: After email sent update recordset feild
VB Code:
DoCmd.SendObject , , acFormatTXT, stEmailAddress3 & ";" & stEmailAddress, stEmailAddress4 & ";" & stEmailAddress2, , stSubject, stText, -1
rs.Edit
'this assumes you have a field in the rs called strEmailsent
'If this isn't the actual name of the field, use the correct one
rs!strEmailsent = -1
rs.Update
'you don't need .Movenext unless this is in a loop you didn't include in the post
rs.MoveNext
Hack, why use -1 instead of True?
Tengo mas preguntas que contestas
-
Sep 13th, 2005, 12:30 PM
#9
Re: After email sent update recordset feild
Are you using a DAO recordset or a ADO one?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Sep 13th, 2005, 12:57 PM
#10
Thread Starter
Hyperactive Member
Re: After email sent update recordset feild
 Originally Posted by salvelinus
VB Code:
DoCmd.SendObject , , acFormatTXT, stEmailAddress3 & ";" & stEmailAddress, stEmailAddress4 & ";" & stEmailAddress2, , stSubject, stText, -1
rs.Edit
'this assumes you have a field in the rs called strEmailsent
'If this isn't the actual name of the field, use the correct one
rs!strEmailsent = -1
rs.Update
'you don't need .Movenext unless this is in a loop you didn't include in the post
rs.MoveNext
Hack, why use -1 instead of True?
This worked! I know what I want to do, but syntax kills me since I don't know anything about programming. Yes I have it in a Loop statement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|