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.
Command Button to Create Email in Outlook Problem
Collapse
X
-
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 -
Originally posted by missinglinqWithout 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 DatabaseComment
Comment