By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 909 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Form and Email sent from Access

P: n/a
I have a main form containing a command SEND button that prompts an
email form to pop up.

The email address(es) that are supposed to appear on the email form
are those corresponding to the respective agency record appearing on
the main form at the current time.

Instead, what I get is the email form without the appropriate
information in the textboxes of the email form.

I checked the earlier version of the database for answers, the VBA
code of the command SEND button, the email form and the query
supplying values to the email form!

I can't figure this one out!

Any suggestions?

Thanks,
John
Sep 8 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Could you provide a little more information? For example, by "email
form" do you mean an Access form or an Outlook form? What does your VBA
procedure look like? What is your query like?

We really don't have enough to go on right now to give you any sort of
meaningful assistance.

Thanks,

Carlos

zufie <jo***********@illinois.govwrote in news:133d7375-3cb0-484f-995c-
2b**********@i76g2000hsf.googlegroups.com:
I have a main form containing a command SEND button that prompts an
email form to pop up.

The email address(es) that are supposed to appear on the email form
are those corresponding to the respective agency record appearing on
the main form at the current time.

Instead, what I get is the email form without the appropriate
information in the textboxes of the email form.

I checked the earlier version of the database for answers, the VBA
code of the command SEND button, the email form and the query
supplying values to the email form!

I can't figure this one out!

Any suggestions?

Thanks,
John
Sep 9 '08 #2

P: n/a
On Sep 9, 12:39*pm, "Carlos Nunes-Ueno" <sulla...@athotmaildot.com>
wrote:
Could you provide a little more information? *For example, by "email
form" do you mean an Access form or an Outlook form? *What does your VBA
procedure look like? *What is your query like?

We really don't have enough to go on right now to give you any sort of
meaningful assistance.

Thanks,

Carlos

zufie <john.marru...@illinois.govwrote in news:133d7375-3cb0-484f-995c-
2b86832bd...@i76g2000hsf.googlegroups.com:
I have a main form containing a command SEND button that prompts an
email form to pop up.
The email address(es) that are supposed to appear on the email form
are those corresponding to the respective agency record appearing on
the main form at the current time.
Instead, what I get is the email form without the appropriate
information in the textboxes of the email form.
I checked the earlier version of the database for answers, the VBA
code of the command SEND button, the email form and the query
supplying values to the email form!
I can't figure this one out!
Any suggestions?
Thanks,
John- Hide quoted text -

- Show quoted text -
Yes, Sorry.

I have a form "frmIBCCP Referral" which contains a Send command button
and a textbox containing the email address for the respective agency
record on the "frmIBCCP Referral".

Here is the VBA behind the Send command button:

Private Sub Command39_Click()
On Error GoTo Err_Command39_Click

Dim stDocName As String
Dim stLinkCriteria As String
Me.Refresh

stDocName = "frmIBCCPemail"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command39_Click:
Exit Sub

Err_Command39_Click:
MsgBox Err.Description
Resume Exit_Command39_Click

End Sub

The Send command button opens another form, frmIBCCPemail.

After clicking the Send command button on "frmIBCCP Referral" the
following should show on the frmIBCCPemail:

frmIBCCPemail also contains a textbox containing the same email
address for the respective agency record on the "frmIBCCP Referral".

frmIBCCPemail will also show a second email address in the textbox
(for the respective agency record on the "frmIBCCP Referral") that one
can see using the via navigation buttons at the bottom of
frmIBCCPemail.

What instead occurs is that I receive a:

"Enter Parameter Value" dialogue box with the following on it: [Forms]!
[Main].[frmIBCCPReferrals].[Form].[Agency]

AND

After I click the Send command button on frmIBCCPemail I receive the
following:

"Run-Time Error 2498 - An expression you entered is the wrong data
type for one of the arguments".

Here is the VBA code when I try to debug:

Private Sub Command37_Click()
DoCmd.SendObject acSendReport, "rptIBCCPReferrals", acFormatSNP, Me!
Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[SentTo].Value = Me!Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[DateSent].Value = Now()
End Sub

The second line of the VBA code, DoCmd.SendObject acSendReport,
"rptIBCCPReferrals", acFormatSNP, Me!Email
appears highlighted when I debug.

The Send command button on frmIBCCPemail should open an MS Outlook
2003 email message.

Hope this is enough detail.

Thanks,

John

Sep 10 '08 #3

P: n/a
On Sep 10, 9:59*am, zufie <john.marru...@illinois.govwrote:
On Sep 9, 12:39*pm, "Carlos Nunes-Ueno" <sulla...@athotmaildot.com>
wrote:


Could you provide a little more information? *For example, by "email
form" do you mean an Access form or an Outlook form? *What does your VBA
procedure look like? *What is your query like?
We really don't have enough to go on right now to give you any sort of
meaningful assistance.
Thanks,
Carlos
zufie <john.marru...@illinois.govwrote in news:133d7375-3cb0-484f-995c-
2b86832bd...@i76g2000hsf.googlegroups.com:
I have a main form containing a command SEND button that prompts an
email form to pop up.
The email address(es) that are supposed to appear on the email form
are those corresponding to the respective agency record appearing on
the main form at the current time.
Instead, what I get is the email form without the appropriate
information in the textboxes of the email form.
I checked the earlier version of the database for answers, the VBA
code of the command SEND button, the email form and the query
supplying values to the email form!
I can't figure this one out!
Any suggestions?
Thanks,
John- Hide quoted text -
- Show quoted text -

Yes, Sorry.

I have a form "frmIBCCP Referral" which contains a Send command button
and a textbox containing the email address for the respective agency
record on the "frmIBCCP Referral".

Here is the VBA behind the Send command button:

Private Sub Command39_Click()
On Error GoTo Err_Command39_Click

* * Dim stDocName As String
* * Dim stLinkCriteria As String
* * Me.Refresh

* * stDocName = "frmIBCCPemail"
* * DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command39_Click:
* * Exit Sub

Err_Command39_Click:
* * MsgBox Err.Description
* * Resume Exit_Command39_Click

End Sub

The Send command button opens another form, frmIBCCPemail.

After clicking the Send command button on "frmIBCCP Referral" the
following should show on the frmIBCCPemail:

frmIBCCPemail also contains a textbox containing the same email
address for the respective agency record on the "frmIBCCP Referral".

frmIBCCPemail will also show a second email address in the textbox
(for the respective agency record on the "frmIBCCP Referral") that one
can see using the via navigation buttons at the bottom of
frmIBCCPemail.

What instead occurs is that I receive a:

"Enter Parameter Value" dialogue box with the following on it: [Forms]!
[Main].[frmIBCCPReferrals].[Form].[Agency]

AND

After I click the Send command button on frmIBCCPemail I receive the
following:

"Run-Time Error 2498 - An expression you entered is the wrong data
type for one of the arguments".

Here is the VBA code when I try to debug:

Private Sub Command37_Click()
DoCmd.SendObject acSendReport, "rptIBCCPReferrals", acFormatSNP, Me!
Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[SentTo].Value = Me!Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[DateSent].Value = Now()
End Sub

The second line of the VBA code, DoCmd.SendObject acSendReport,
"rptIBCCPReferrals", acFormatSNP, Me!Email
appears highlighted when I debug.

The Send command button on frmIBCCPemail should open an MS Outlook
2003 email message.

Hope this is enough detail.

Thanks,

John- Hide quoted text -

- Show quoted text -
Upon opening the database I also receive the Run-Time Error 2465 - MS
Access can't find the field "Agency" referred to in your expression.

Here is the VBA when I debug:

Private Sub Form_Current()
Me!Agency.Requery
'Debug.Print Me!Agency
End Sub

The second line of the VBA code, Me!Agency.Requery, appears
highlighted when I debug.

Thanks,

John
Sep 10 '08 #4

P: n/a
You're getting the "Enter Parameter Value" message because the query that
you're basing frmIBCCPemail has [Forms]![Main].[frmIBCCPReferrals].
[Form].[Agency] as a criterion and that expression is not resolving to a
value. I would check that first and make sure that the Agency control is
still there and that the name you have there is correct and so on. The
fact that you're getting the "Access can't find the field" error also
strongly suggests taht the field has been deleted or renamed.

I'm not sure what to make of the second issue. It would seem like it
would be due to the Email field, but I can't reproduce the problem. The
other arguments should be fine, especially since two of them are VB
constants. I'd suggest putting a break point before that line and adding
something like Debug.Print Me!Email and see if you're getting what you
expect.

Hope that helps,

Carlos

zufie <jo***********@illinois.govwrote in
news:3f**********************************@25g2000h sx.googlegroups.com:
>>
Yes, Sorry.

I have a form "frmIBCCP Referral" which contains a Send command
button and a textbox containing the email address for the respective
agency record on the "frmIBCCP Referral".

Here is the VBA behind the Send command button:

Private Sub Command39_Click()
On Error GoTo Err_Command39_Click

* * Dim stDocName As String
* * Dim stLinkCriteria As String
* * Me.Refresh

* * stDocName = "frmIBCCPemail"
* * DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command39_Click:
* * Exit Sub

Err_Command39_Click:
* * MsgBox Err.Description
* * Resume Exit_Command39_Click

End Sub

The Send command button opens another form, frmIBCCPemail.

After clicking the Send command button on "frmIBCCP Referral" the
following should show on the frmIBCCPemail:

frmIBCCPemail also contains a textbox containing the same email
address for the respective agency record on the "frmIBCCP Referral".

frmIBCCPemail will also show a second email address in the textbox
(for the respective agency record on the "frmIBCCP Referral") that
one can see using the via navigation buttons at the bottom of
frmIBCCPemail.

What instead occurs is that I receive a:

"Enter Parameter Value" dialogue box with the following on it:
[Forms]! [Main].[frmIBCCPReferrals].[Form].[Agency]

AND

After I click the Send command button on frmIBCCPemail I receive the
following:

"Run-Time Error 2498 - An expression you entered is the wrong data
type for one of the arguments".

Here is the VBA code when I try to debug:

Private Sub Command37_Click()
DoCmd.SendObject acSendReport, "rptIBCCPReferrals", acFormatSNP, Me!
Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[SentTo].Value = Me!Email
[Forms]![Main].[frmIBCCPReferrals].[Form].[DateSent].Value = Now()
End Sub

The second line of the VBA code, DoCmd.SendObject acSendReport,
"rptIBCCPReferrals", acFormatSNP, Me!Email
appears highlighted when I debug.

The Send command button on frmIBCCPemail should open an MS Outlook
2003 email message.

Hope this is enough detail.

Thanks,

John- Hide quoted text -

- Show quoted text -

Upon opening the database I also receive the Run-Time Error 2465 - MS
Access can't find the field "Agency" referred to in your expression.

Here is the VBA when I debug:

Private Sub Form_Current()
Me!Agency.Requery
'Debug.Print Me!Agency
End Sub

The second line of the VBA code, Me!Agency.Requery, appears
highlighted when I debug.

Thanks,

John
Sep 10 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.