I'm using access to read in data from several fields and send an e-mail. I can capture one of the fields in the file into a variable (full_link), but not the others. Whenever it hits the variable assignment line for the other fields, I get a "Method or Data Member not found" error. If I hard-code the other fields but still have the strFullLink variable, it works fine. What am I missing?
Private Sub Command0_Click()
Dim strToWhom As String
Dim strSubject As String
Dim strBody As String
Dim strMsgBody As String
Dim intSeeOutlook As Integer
Dim strFullLink As String
DoCmd.OpenTable "table_email"
strFullLink = Me.full_link
strToWhom = Me.mail_add
strSubject = Me.mail_sub
'strToWhom = InputBox("Enter recipient's e-mail address.")
'strSubject = InputBox("Enter Subject.")
strBody = "Your package has been sent. It may be tracked with the following link: " + strFullLink
DoCmd.SendObject , , , strToWhom, , , strSubject, strBody, intSeeOutlook
x = MsgBox("Email has been sent")
End Sub
3 2614
Okay, solved that one. All I had to do was remove the data source (which did not have those fields when I linked it to the table) and re-add it.
Okay, new problem. I'm looping through the table to grab information and send an e-mail to each. However, the variables are not being re-set. The e-mail is being sent each time, but it's all the information from the first record. I know it's getting all the way through the loop, so why are the variables not reset to the next record's value?
Private Sub Command0_Click()
Dim intCounter As Integer
Dim strToWhom As String
Dim strSubject As String
Dim strBody As String
Dim strMsgBody As String
Dim intSeeOutlook As Integer
Dim strFullLink As String
DoCmd.OpenTable "table_email"
intCounter = 0
Do While intCounter < 10
strFullLink = Me.full_link
strToWhom = Me.mail_add
strSubject = Me.mail_sub
'strToWhom = InputBox("Enter recipient's e-mail address.")
'strSubject = InputBox("Enter Subject.")
strBody = "Your package has been sent. It may be tracked with the following link: " + strFullLink
DoCmd.SendObject , , , strToWhom, , , strSubject, strBody, intSeeOutlook
'x = MsgBox("Email has been sent")
DoCmd.GoToRecord , , acNext
intCounter = intCounter + 1
Loop
End Sub
Okay, new problem. I'm looping through the table to grab information and send an e-mail to each. However, the variables are not being re-set. The e-mail is being sent each time, but it's all the information from the first record. I know it's getting all the way through the loop, so why are the variables not reset to the next record's value?
Private Sub Command0_Click()
Dim intCounter As Integer
Dim strToWhom As String
Dim strSubject As String
Dim strBody As String
Dim strMsgBody As String
Dim intSeeOutlook As Integer
Dim strFullLink As String
DoCmd.OpenTable "table_email"
intCounter = 0
Do While intCounter < 10
strFullLink = Me.full_link
strToWhom = Me.mail_add
strSubject = Me.mail_sub
'strToWhom = InputBox("Enter recipient's e-mail address.")
'strSubject = InputBox("Enter Subject.")
strBody = "Your package has been sent. It may be tracked with the following link: " + strFullLink
DoCmd.SendObject , , , strToWhom, , , strSubject, strBody, intSeeOutlook
'x = MsgBox("Email has been sent")
DoCmd.GoToRecord , , acNext
intCounter = intCounter + 1
Loop
End Sub
Hi, there.
Pay attention to your code.
Your open a table -
DoCmd.OpenTable "table_email"
and loop through its records -
DoCmd.GoToRecord , , acNext
but gather data from a form where CommandButton is located. -
strFullLink = Me.full_link
-
strToWhom = Me.mail_add
-
strSubject = Me.mail_sub
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul Lamonby |
last post by:
Hi,
I am sending a file from the server as an email attachment. The file
is being attached no problem and sending the email, but I get an error
when I try to open it saying it is corrupt....
|
by: coder_1024 |
last post by:
I'm trying to send a packet of binary data to a UDP server. If I send
a text string, it works fine. If I attempt to send binary data, it
sends a UDP packet with 0 bytes of data (just the...
|
by: Robert A. van Ginkel |
last post by:
Hello Fellow Developer,
I use the System.Net.Sockets to send/receive data (no
tcpclient/tcplistener), I made a receivethread in my wrapper, the
receivethread loops/sleeps while waiting for data...
|
by: yaron |
last post by:
Hi,
I have a problem when sending data over TCP socket from c# client to java
server.
the connection established ok, but i can't send data from c# client to java
server.
it's work ok with...
|
by: Sydney |
last post by:
Hi,
I am trying to construct a WSE 2.0 security SOAP request in VBScript on an
HTML page to send off to a webservice. I think I've almost got it but I'm
having an issue generating the nonce...
|
by: Sells, Fred |
last post by:
I'm using MSW XP Pro with Python 2.4 to develop but production will be Linux
with Python 2.3. (could upgrade to 2.4 if absolutely necessary) I can also
switch to Linux for development if...
|
by: Miro |
last post by:
VB 2003
at the end of the code, this works great.
bytCommand = Encoding.ASCII.GetBytes("testing hello send text")
udpClient.Send(bytCommand, bytCommand.Length)
and this recieves it
Dim...
|
by: remya1000 |
last post by:
by using FTP i can send files to server using vb.net.
if the file is big, then it will take some time to complete the sending process to server.or if we were sending 3-4 files to the server one by...
|
by: Markgoldin |
last post by:
I am sending an XML data from not dontnet process to a .Net via socket
listener.
Here is a data sample:
<VFPData>
<serverdata>
<coderun>updateFloor</coderun>
<area>MD2</area>...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
| |