Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error- Properties or Code?

Status
Not open for further replies.

Hookstrat

Technical User
Jun 11, 2002
43
US
I am using Access 2000 and I have created a Telephone Directory to use over the LAN. I made a data access page, because everyone doesn't have Access installed on their computers. I am now trying to put in a button that will open Outlook from my access page, and possibly insert information from the database into Outlook. I have two codes that I have been working on and both have been giving me scripting errors. I know that if I was using a form I need to put a statement in OnCLick properties of my command button, but in the data access page it doesn't give me that option. I tried to putting the code on the OnMouseEnter but with no avail. I have a command button ("Object:RunOutlook") with the properties: Name - RunOutlook and Value - Start Outlook. Here is my first code:
[\code]
<SCRIPT language=vbscript event=onclick for=RunOutlook>
<!--
Private Sub cmdRunOutlook_Click
On error GoTo HandleErr
'Save the Record
If Me.Dirty then DoCmd.RunCommand ac CmdSaveRecord
'Make sure the hyperlink property is current
EnableEmail
Exithere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & &quot;: &quot; & Err.Description, _, &quot;Page_PhoneDirectoryByLastName.cmdEmailContact_Click&quot;
End Select
Resume ExitHere
-->
</SCRIPT>
Code:
Do I need to add something else to my properties or is my code on the wrong track??  Should I be using objects or something?  This is the code I tried to manipulate into the OnMouseEnter event:
[\code]
<SCRIPT language=vbscript event=onmouseenter for=RunOutlook>
<!--
Public Function StartOutLook()
         On Error GoTo StartOutLook_Error
        Dim spObj As Object, MyItem As Object

         ' Create a Microsoft OutLook object.
        Set spObj = CreateObject(&quot;Outlook.Application&quot;)

         ' Create and open new contact form for input.
         Set MyItem = spObj.CreateItem(olContactItem)
         MyItem.Display

         ' Quit Microsoft Outlook.
        Set spObj = Nothing
       Exit Function

      StartOutLook_Error:
        MsgBox &quot;Error: &quot; & Err & &quot; &quot; & Error
       Exit Function
      End Function
-->
</SCRIPT>
[code]
I also have the Microsoft Outlook 9.0 Object Library loaded.  I am not really looking for a full coded answer, but if anyone can give me some direction I would be very grateful.  I am about to give up on this project all together.                       Thank you,
                                 L.H.
 
why do you need all the workstations to have access installed on them to view the records? You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
How else can users without Access installed on their system view the information that would normally be viewed in forms or reports? Unless I am mistaked the only way to allow non-Access installed users to view records is through a data access page or asp. Thank you for replying onpnt,
L.H.
 
apologies, I thought you refered to that with asp not without.[hammer]
You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top