473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Command Button to Create Email in Outlook Problem

93
I have a command button on two different forms that are exactly the same only named different. When you hit the button it creates an Outlook Email filling in the TO, Subject, and Email Text. It works on one form but not the other. Am I missing something on the form it is not working on. On the form that it does not work on it gives me a Compile Error: Variable not defined. I would have sent the code but I know it is correct since it works perfectly on one form. Thanks in advance.
May 22 '08 #1
2 1683
missinglinq
3,532 Expert 2GB
Without actually laying eyes on your forms, my guess would be that the form that works has the option statement

Option Compare Database


as its first line, which is the Default when a form is created, but the misbehaving form has the option statement

Option Explicit

This second option requires that you explicitly define all variables before using them, with an appropriate Dim statement, such as

Dim MyVariable as String

and I'm guessing that you haven't done this. Either Dim all variables in the offending form, or change its Option statement.

Welcome to bytes!

Linq ;0)>



Option Compare Database
May 22 '08 #2
clloyd
93
Without actually laying eyes on your forms, my guess would be that the form that works has the option statement

Option Compare Database


as its first line, which is the Default when a form is created, but the misbehaving form has the option statement

Option Explicit

This second option requires that you explicitly define all variables before using them, with an appropriate Dim statement, such as

Dim MyVariable as String

and I'm guessing that you haven't done this. Either Dim all variables in the offending form, or change its Option statement.

Welcome to bytes!

Linq ;0)>



Option Compare Database
Thanks that solved this problem.
May 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: bearophileHUGS | last post by:
Hello, I have four things to ask or to suggest, sorry if they seem basic or already discussed. ------------------- I am still ignorant about Tkinter. This little program, after pressing the...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
6
by: Mr. Bungle | last post by:
I would like to send email automatically via a command button. I have accomplished this just fine through the following code: (Outlook should already be open for reliable results) Private Sub...
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
4
by: Elliot M. Rodriguez | last post by:
I have a Delete button in my datagrid. I'm attempting to add some code confirming whether the user wishes to really delete the item or not. The confirm pops up, but I cannot suppress the...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
1
by: Divyesh Modi | last post by:
hi, I wnat to create one button to open outlook application and embed HTML that page where i open the outlook. I have example : when you open any web page in IE and go
2
beacon
by: beacon | last post by:
I have a DAP that I've added a command button to (and by default is set to be coded using vbscript, but I'll use whatever works). The command button uses the onclick method to look at a dropdown...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
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...

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.