email right click  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | |
i have to set up a access database with details of mp3s held on company server with the facility to search them, i need to know if it is possible to right click on a found mp3 in the database and send the file it lists by email just like you can with an image on a website thanks
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click Quote:
Originally Posted by colinod i have to set up a access database with details of mp3s held on company server with the facility to search them, i need to know if it is possible to right click on a found mp3 in the database and send the file it lists by email just like you can with an image on a website thanks Access does not have an on right click facility.
Your options would be to use the on click, on double click event or a command button. You can then use the send object method to send the information by email.
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
where do you set this up from i amm very new to using access for this
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click Quote:
Originally Posted by colinod where do you set this up from i amm very new to using access for this I'm speaking of vba.
If in form design you right click on the textbox containing the data and open properties then look under the event tab you will see a list of the "events".
Choose an event (like On Click) and click on the little arrow to the right. Select [Event Procedure] from the list. Then click the button to the right with the dots. You would add your Send Object code to the blank event procedure that appears.
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
thank mmcarthy i have tried what you said but im afraid i have never used vba before i get as far as the input code point but im not sure what to put or exactly where, this is what i have so far
Option Compare Database
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
Private Sub filename_Click()
End Sub
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click
OK so in Private Sub filename_Click() try something like the following: -
Option Compare Database
-
Option Explicit
-
-
Private Sub Command8_Click()
-
On Error GoTo Err_Command8_Click
-
-
-
Screen.PreviousControl.SetFocus
-
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
-
-
Exit_Command8_Click:
-
Exit Sub
-
-
Err_Command8_Click:
-
MsgBox Err.Description
-
Resume Exit_Command8_Click
-
-
End Sub
-
-
Private Sub filename_Click()
-
-
DoCmd.SendObject ObjectType:=acSendNoObject, _
-
Subject:="mp3 details", _
-
To:="Tom Jones", _
-
EditMessage:=True, _
-
MessageText:=Me!filename
-
-
End Sub
-
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
this is not quite what i was looking for i was hoping for it to be sent using outlook or outlook express so we could enter an email address etc thanks anyway
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click
This will open outlook or outlook express. Just change 'Tom Jones' to whatever email address you want. For example ... -
Option Compare Database
-
Option Explicit
-
-
Private Sub Command8_Click()
-
On Error GoTo Err_Command8_Click
-
-
-
Screen.PreviousControl.SetFocus
-
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
-
-
Exit_Command8_Click:
-
Exit Sub
-
-
Err_Command8_Click:
-
MsgBox Err.Description
-
Resume Exit_Command8_Click
-
-
End Sub
-
-
Private Sub filename_Click()
-
-
DoCmd.SendObject ObjectType:=acSendNoObject, _
-
Subject:="mp3 details", _
-
To:="Tom.Jones@yahoo.com", _
-
EditMessage:=True, _
-
MessageText:=Me!filename
-
-
End Sub
-
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
sorry to be pain but i have tried this and am getting the following in an alert box
The expression On Click you entered as the event property settign produced the following error:Ambiguous name detected:Command8_Click
* The expression may not result in the name os a macro, the name of a user defined function, or [event procedure]
*There may have been an error evaluating the function, event, or macro
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
its ok i have sorted it i made the mistake of not replacing the whole script thanks
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
ok i have got it to open the email but i am trying to attach an mp3 file from a folder in our network have you got any ides an this maybe the way it is written in the access database
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
Hi all
The code used also adds the mp3 just as text in the message and not as an attachment????
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click Quote:
Originally Posted by colinod Hi all
The code used also adds the mp3 just as text in the message and not as an attachment???? Sorry I misread your original question. Attaching something that is not a database object like an mp3 file will require much more complicated code.
To see what I mean have a look at these two other questions for two ways of doing this. http://www.thescripts.com/forum/thread706529.html http://www.thescripts.com/forum/thread553562.html
Mary
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
Sorry im afraid i just do not understand the codes its beyond me at the moment????
|  | Administrator | | Join Date: Aug 2006 Location: Dublin, Ireland
Posts: 10,886
| | | re: email right click Quote:
Originally Posted by colinod Sorry im afraid i just do not understand the codes its beyond me at the moment???? In all honesty I think it is. You need to get a good grounding in Access and VBA before attempting something this complicated.
|  | Familiar Sight | | Join Date: Nov 2007
Posts: 182
| | | re: email right click
ok thanks anyway i will go back to trying to do it with a web form and asp
|  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|