G
Guest
Good morning,
I feel that I have a 'decent' grasp on my code, but I cannot figure out why
I am being prompted for a parameter for 'htmlfilename' when I am assigning a
value to it from within. Can someone help, please? (watch the word wraps)
Thank you in advance!
Option Compare Database
Public Sub cbSubmitProject_Click()
Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Dim strfilename As String
Dim htmlfilename As String
If IsNull(BudgetLine) = False Then
Set xlApp = CreateObject("excel.application")
xlApp.Visible = True
Set xlWorkbook =
xlApp.Workbooks.Open("v:\distcntr\dcdesign\projmgmt\Capital05\CER\CER_V15.xls")
Set xlsheet = xlWorkbook.Sheets(3)
strfilename = "v:\distcntr\dcdesign\projmgmt\Capital" &
Forms!frmNewProject.ProjectYear & "\CER\" &
Left(Forms!frmNewProject.BudgetLine, 2) & "\" &
Left(Forms!frmNewProject.BudgetLine, 2) & Forms!frmNewProject.ProjectName &
".xls"
xlWorkbook.SaveAs (strfilename)
htmlfilename = "#file:///" & strfilename & "#"
DoCmd.RunSQL "INSERT INTO tblProject (ProjectName, ProjectYear,
ProjectID, BudgetLI, BudgetCost, ProjectStatus, ProjectPath, SYSMID,
[TimeStamp]) SELECT forms!frmNewProject.ProjectName,
[Forms]![frmNewProject].[ProjectYear], [forms].[frmNewProject].[ProjectID],
[Forms]![frmNewProject].[BudgetLine], [Forms]![frmNewProject].[BudgetCost],
'ProofReading', htmlfilename, fOSUserName(), Now()"
DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , , "A CER
is ready for your review", "Frank," & Chr$(13) & "Please open the Budget Tool
and proofread the CER for " & Forms!frmNewProject.ProjectName & ". In the
application, you will have the option to request me to make corrections or to
pass on to my GM for signature.", False
DoCmd.OpenForm "frmAuths"
End If
DoCmd.Close acForm, "frmNewProject"
End Sub
I feel that I have a 'decent' grasp on my code, but I cannot figure out why
I am being prompted for a parameter for 'htmlfilename' when I am assigning a
value to it from within. Can someone help, please? (watch the word wraps)
Thank you in advance!
Option Compare Database
Public Sub cbSubmitProject_Click()
Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Dim strfilename As String
Dim htmlfilename As String
If IsNull(BudgetLine) = False Then
Set xlApp = CreateObject("excel.application")
xlApp.Visible = True
Set xlWorkbook =
xlApp.Workbooks.Open("v:\distcntr\dcdesign\projmgmt\Capital05\CER\CER_V15.xls")
Set xlsheet = xlWorkbook.Sheets(3)
strfilename = "v:\distcntr\dcdesign\projmgmt\Capital" &
Forms!frmNewProject.ProjectYear & "\CER\" &
Left(Forms!frmNewProject.BudgetLine, 2) & "\" &
Left(Forms!frmNewProject.BudgetLine, 2) & Forms!frmNewProject.ProjectName &
".xls"
xlWorkbook.SaveAs (strfilename)
htmlfilename = "#file:///" & strfilename & "#"
DoCmd.RunSQL "INSERT INTO tblProject (ProjectName, ProjectYear,
ProjectID, BudgetLI, BudgetCost, ProjectStatus, ProjectPath, SYSMID,
[TimeStamp]) SELECT forms!frmNewProject.ProjectName,
[Forms]![frmNewProject].[ProjectYear], [forms].[frmNewProject].[ProjectID],
[Forms]![frmNewProject].[BudgetLine], [Forms]![frmNewProject].[BudgetCost],
'ProofReading', htmlfilename, fOSUserName(), Now()"
DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , , "A CER
is ready for your review", "Frank," & Chr$(13) & "Please open the Budget Tool
and proofread the CER for " & Forms!frmNewProject.ProjectName & ". In the
application, you will have the option to request me to make corrections or to
pass on to my GM for signature.", False
DoCmd.OpenForm "frmAuths"
End If
DoCmd.Close acForm, "frmNewProject"
End Sub