diff --git a/PriceLists.bas b/PriceLists.bas index 198bd9f..ea5bfb0 100644 --- a/PriceLists.bas +++ b/PriceLists.bas @@ -34,7 +34,7 @@ Sub test_full20() unp = unpivot_current_sheet(lists, pcol) - login.Caption = "Postgres Login" + login.Caption = "PostgreSQL Login" login.tbU = "report" login.tbP = "report" login.Show @@ -354,7 +354,7 @@ PRICELIST_SHOW: '--------Open file------------- - If Not x.FILEp_CreateCSV(pricelist.tbPATH.text & "\" & Replace(pl_code, ".", "_") & ".csv", ul) Then + If Not x.FILEp_CreateCSV(pricelist.tbPath.text & "\" & Replace(pl_code, ".", "_") & ".csv", ul) Then MsgBox ("error") End If @@ -490,6 +490,7 @@ Sub build_customer_files() Dim effdate As Date '----------------------pick price level--------------------------------------------------------------------- + login.Caption = "PostgreSQL Login" login.tbU = "report" login.tbP = "report" login.Show @@ -503,7 +504,7 @@ Sub build_customer_files() Exit Sub End If effdate = CDate(pricelevel.tbEddDate.text) - filepath = pricelevel.tbPATH & "\" & plev + filepath = pricelevel.tbPath & "\" & plev '---------------------get full code list-------------------------------------------------------------------- fc = x.ADOp_SelectS(0, "SELECT * FROM rlarp.plcore_build_fullcode_cust('" & plev & "', '" & effdate & "'::date)", False, 20000, True, PostgreSQLODBC, "usmidlnx01", False, login.tbU.text, login.tbP.text, "Port=5030;Database=ubm") @@ -739,7 +740,7 @@ Sub build_customer_files() End If Next wb - If filepath <> "" Then nwb.SaveAs Filename:=filepath & "\HC Companies Distributor Price List.xlsx" + If pricelevel.tbPath.text <> "" Then nwb.SaveAs Filename:=filepath & "\HC Companies Distributor Price List.xlsx" For Each wb In Workbooks If wb.Name = "HC FullCode List.xlsx" Then @@ -752,7 +753,7 @@ Sub build_customer_files() End If Next wb - If filepath <> "" Then fcwb.SaveAs Filename:=filepath & "\HC FullCode List.xlsx" + If pricelevel.tbPath.text <> "" Then fcwb.SaveAs Filename:=filepath & "\HC FullCode List.xlsx" End Sub diff --git a/pricelevel.frm b/pricelevel.frm index 8001ba5..463b300 100644 --- a/pricelevel.frm +++ b/pricelevel.frm @@ -34,7 +34,7 @@ Private Sub cbFolder_Click() Set fd = Application.FileDialog(msoFileDialogFolderPicker) fd.Show - tbPATH.text = fd.SelectedItems(1) + tbPath.text = fd.SelectedItems(1) End Sub diff --git a/pricelevel.frx b/pricelevel.frx index 6bcad5b..7701644 100644 Binary files a/pricelevel.frx and b/pricelevel.frx differ diff --git a/pricelist.frm b/pricelist.frm index f730575..1be657c 100644 --- a/pricelist.frm +++ b/pricelist.frm @@ -31,7 +31,7 @@ End Sub Private Sub bOK_Click() - If tbPATH = "" Then + If tbPath = "" Then MsgBox ("no directory specified") Exit Sub End If @@ -49,7 +49,7 @@ Private Sub bPICK_Click() Set fd = Application.FileDialog(msoFileDialogFolderPicker) fd.Show - tbPATH.text = fd.SelectedItems(1) + tbPath.text = fd.SelectedItems(1) End Sub @@ -108,7 +108,7 @@ Private Sub UserForm_Initialize() cbDTL.list = dtl login.Caption = "CMS Login" - login.tbU = Mid(Application.UserName, 1, 10) + login.tbU = UCase(Mid(Mid(Application.UserLibraryPath, 10, InStr(10, Application.UserLibraryPath, "\") - 10), 1, 10)) login.tbP = "" login.Show If Not login.proceed Then Exit Sub diff --git a/pricelist.frx b/pricelist.frx index 594136e..95439c4 100644 Binary files a/pricelist.frx and b/pricelist.frx differ