<p>In the office we use a access 2003 database (here is the picture)</p><p><img alt="" src="https://social.technet.microsoft.com/Forums/getfile/683485" /></p><p>When i click on the red assigned button, i got an error like this :</p><p><img alt="" src="https://social.technet.microsoft.com/Forums/getfile/683487" /></p><p></p><div></div>
Here is the button code:
Private Sub emailklds_Click()
On Error GoTo Err_emailklds_Click
Dim stDocName As String
stDocName = "Igny_riport"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Select Case Me!capex_opex
Case "CAPEX"
If IsNull(Me![Projektkd]) Or IsNull(Me![PST_kd_capex]) Or IsNull(Me![PST_kd_tech]) Then MsgBox "A Projektkd, PST kd s PST tech. kd nem maradhat resen!", vbCritical Else: DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Case "OPEX"
If IsNull(Me![Kltsghely]) Then MsgBox "A Kltsghely nem maradhat resen!", vbCritical Else: DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Case Else
MsgBox "A Capex/Opex mez csak a kvetkez rtkeket tartalmazhatja: CAPEX vagy OPEX!", vbCritical
End Select
Select Case Me!capex_opex
Case "CAPEX"
If IsNull(Me![Projektkd]) Or IsNull(Me![PST_kd_capex]) Or IsNull(Me![PST_kd_tech]) Then GoTo vge:
Case "OPEX"
If IsNull(Me![Kltsghely]) Then GoTo vge:
End Select
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO LOG_rtestsklds (Usernv, Dtum, To, CC, Ignyazonost, Esemny, File) VALUES (currentuser(), now(), felettesemail, Helyettesemail , Ignyazonost, 'Felettes rtesitse', Ignyazonost & '_anyagigny_' & date() & '_' & Ignyl & '.snp' )")
'DoCmd.SetWarnings True
Me!Ttelszerkeszts = -1
Me!Jvhagysra_kldve = Now()
'[mdosts].Enabled = False
DoCmd.OpenReport stDocName, acViewDesign, , , acHidden
Reports(stDocName).Caption = Me!Ignyazonost & "_anyagigny_" & Format(Date, "yyyy-mm-dd") & "_" & Me!Ignyl
' DoCmd.OpenReport stDocName, acViewNormal
DoCmd.SendObject acSendReport, stDocName, acFormatSNP, felettesemail & ";" & Helyettesemail, , , "Anyagignyls, jvhagysra: " & Igny_neve & " (Ignyazonost: " & Ignyazonost & ")", "Szia," & Chr(13) & Chr(13) & "Krlek engedlyezd az albbi anyagignylst az anyagignyl rendszerben!" & Chr(13) & Chr(13) & "Ksznm," & Chr(13) & Chr(13) & Ignyl_neve
DoCmd.Close acReport, stDocName, acSaveNo
Exit_emailklds_Click:
Exit Sub
Err_emailklds_Click:
DoCmd.Close acReport, stDocName, acSaveNo
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO LOG_rtestsklds (Usernv, Dtum, To, CC, Ignyazonost, Esemny, File) VALUES (currentuser(), now(), felettesemail, Helyettesemail, Ignyazonost, 'Felettes rtesitse - klds megszaktva', Ignyazonost & '_anyagigny_' & date() & '_' & Ignyl & '.snp' )")
DoCmd.SetWarnings True
MsgBox Err.Description
Resume Exit_emailklds_Click
vge:
End SuB
Somebody can help me with this?
Maybe the access 2003 db wont work with outlook 2010 when i want to send an email?
Ohh and the button function is to send an email to a person.
Thanks in advance!