Donneray

Information from classes and day to day stuff

Creating a new folder with YYYY-MM-DD

  1. Go to registry editor using ‘regedit’ command.
  2. Go to HKEY_CLASSES_ROOT\Directory\shell.
  3. Make a new key New Folder.
  4. Inside this key, create another key command.
  5. Type the following value for the key inside it: cmd.exe /c md “%1/%%DATE%%”
  6. Save and exit registry editor.
  7. Right-click on the folder in Windows Explorer, and click on New Folder

Rules of Programming

  • Indent
  • Naming conventions
  • Method Names
  • Hungarian Notation
  • Camel Case
  • Small Methods (usually less than half a page)
  • Dim at top (usually)
  • Dim all variables
  • Description of what method dos at top
  • Ease of maintenance in writing

FindInfo macro

Is below:

 

Sub FindInfo()
'
' FindInfo Macro
'
' Keyboard Shortcut: Ctrl+w
'
    Dim vendcode As String
    Dim itemcode As String
    Dim vendcodecurrent As String
    Dim itemcodecurrent As String
    Dim bolFoundItem As Boolean
    Dim strVendor As String
    Dim strBrand As String
    Dim strStubSpec As String
    Dim numVol_Eq
    Range("E2").Select
    ' Get what we are looking for
    vendcode = ActiveCell.Value
    ActiveCell.Offset(0, 1).Range("A1").Select
    itemcode = ActiveCell.Value
    ActiveCell.Offset(0, -1).Range("A1").Select
    Windows("prod_saltsnck.xlsx").Activate
    Range("H2").Select
    bolFoundItem = False
    i = 1
    Do While bolFoundItem = False
        ' Get what we are on
        vendcodecurrent = ActiveCell.Value
        ActiveCell.Offset(0, 1).Range("A1").Select
        itemcodecurrent = ActiveCell.Value
        ActiveCell.Offset(0, -1).Range("A1").Select
        'Have we found what we are looking for?
        If vendcode = vendcodecurrent Then
            If itemcode = itemcodecurrent Then
                bolFoundItem = True
                ActiveCell.Offset(0, -4).Range("A1").Select
                strVendor = ActiveCell.Value
                ActiveCell.Offset(0, 1).Range("A1").Select
                strBrand = ActiveCell.Value
                ActiveCell.Offset(0, 5).Range("A1").Select
                strStubSpec = ActiveCell.Value
                ActiveCell.Offset(0, 1).Range("A1").Select
                numVol_Eq = ActiveCell.Value
            End If
        End If
        ' Do what is required.
        If bolFoundItem = True Then
            Windows("SaltySnack_Sales.xlsx").Activate
            ActiveCell.Offset(0, 2).Range("A1").Select
            ActiveCell.Value = strVendor
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = strBrand
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = strStubSpec
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = numVol_Eq
            'Move back
            ActiveCell.Offset(0, -5).Range("A1").Select
            'Grab the next value(s)
            ActiveCell.Offset(1, 0).Range("A1").Select
            vendcode = ActiveCell.Value
            ActiveCell.Offset(0, 1).Range("A1").Select
            itemcode = ActiveCell.Value
            ActiveCell.Offset(0, -1).Range("A1").Select
            'Reset
            Windows("prod_saltsnck.xlsx").Activate
            Range("H2").Select
            bolFoundItem = False
            i = 1
            ' Again!
        Else
            ActiveCell.Offset(1, 0).Range("A1").Select
        End If
        If i > 18000 Then
            bolFoundItem = True
            Windows("SaltySnack_Sales.xlsx").Activate
            ActiveCell.Offset(0, 2).Range("A1").Select
            ActiveCell.Value = "Unknown"
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = "Unknown"
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = "Unknown"
            ActiveCell.Offset(0, 1).Range("A1").Select
            ActiveCell.Value = "Unknown"
            'Move back
            ActiveCell.Offset(0, -5).Range("A1").Select
            'Grab the next value(s)
            ActiveCell.Offset(1, 0).Range("A1").Select
            vendcode = ActiveCell.Value
            ActiveCell.Offset(0, 1).Range("A1").Select
            itemcode = ActiveCell.Value
            ActiveCell.Offset(0, -1).Range("A1").Select
            'Reset
            Windows("prod_saltsnck.xlsx").Activate
            Range("H2").Select
            bolFoundItem = False
            i = 1
            ' Again!
        End If
        If Len(Trim(vendcode)) < 2 Then
            If Len(Trim(itemcode)) < 2 Then
                Exit Sub
            End If
        End If
        i = i + 1
   Loop
End Sub

Table Structure for Peachtree

Although I would love to make a picture of the database tables, here are the tables anyway:

ADDRESS.DAT  Customer ShipTo and Vendor RemitTo address data.  Added at V13.
AFLOCAT.DAT   Lookup data for city, state, zipcode and country.  Added at V13 to support pulldown lists.
ALARM.DAT  Alarm events.
ALERT.DAT  Alert events.
AUDITTR.DAT  Audit trail information.
BANKREC.DAT  Temporary file used for reconciliation.
BOM*.DAT  Bill of material data for assemblies.  Added at V11.5. (Partly available with DDE.)
CHART.DAT  Chart of Accounts data. (Available with Export and DDE.)
COMPANY.DAT  Company specific data.  (Available with DDE.)
ConnCO.DAT  Used to control multiple access.  Empty when PT not running.  Has record with Peachtree serial number when PT running.  Probably added at V9.
COST.DAT  Job Cost data.  (Not available with Peachtree First Accounting.)
CUSTOMER.DAT  Customer data. (Available with Export and DDE.)
EMPLOYEE.DAT  Employee data. (Available with Export and DDE.)
EVENTLOG.DAT  Log of certain transactions.
FORECAST.DAT  Created when you use forecasting.
FOREDETL.DAT  Created when you use forecasting.
FA*.DAT  Fixed Asset data. (FALIMIT.DAT
GENERAL.DAT  General and default data.  (Not available with Export.  Only  periods available with DDE.)
GLCOAT.DAT  Text file listing the chart of accounts.  Added at V11.
GRPDATA.DAT  Info about report groups.
INVCHAIN.DAT  Supporting detail for line items.
INVCOMP.DAT  Inventory assembly component data.  Possibly not used starting at V11.
INVCOST.DAT  Details about inventory cost.
INVTAG.DAT  Auxiliary Inventory data.
JOBEST.DAT  Auxiliary job data.
JOBTAG.DAT  V7 only: Auxiliary job data.
JOURNAL.DAT  V7 only: All journal entries are stored in this one file. (Available with Export/DDE.)
JRNLHDR.DAT   V8 and later: Header information for all journals. (Available with Export and DDE)
JRNLROW.DAT   V8 and later: Detail information for all journals. (Available with Export and DDE)
JRNLSNO.DAT   V12 and later: Item serial number data.
LINEITEM.DAT  Inventory item data. (Available with Export and DDE.)
OLACCT.DAT  V13 and later: Purpose unknown.
OLTRANS.DAT  V13 and later: Purpose unknown.
PERMISS.DAT  User permission data.
PHASE.DAT  Job phase data (Not available with Peachtree First Accounting)
PROJECT.DAT  Job data.  (Available with Export and DDE.)
QTYDISC.DAT   V11.5 and later: Contains quantity discount data.
RAISEHST.DAT   V11 and later: Raise history data.  Not used in all flavors.
RECPTTAG.DAT  Receipt tag information. Obsolete but may exist in older data.
REPORT.DAT  Temporary report data.
RPTDATA.DAT  Temporary report data.
RptFiltS.DAT  V11 and later: Report Filter temporary data.
RstyDef.DAT  V8 and later: Contains report styles for report groups.
Rstyle.DAT  V8 and later: Contains constants for each of four styles.
SORTJOB.DAT   V7 only: Report speedup data.
STORETRX.DAT  Obsolete at V13: Memorized Transaction data.
STXHDR.DAT   V13 and later: Memorized Transaction header data.
STXROW.DAT   V13 and later: Memorized Transaction detail data.
TAXAUTH.DAT  Tax Authority data.
TAXCODE.DAT  Sales tax data.
TAXTABLE.DAT  Tax Table data.  (Available with DDE.)
TEMPLATE.DAT  Stores data for template button that appears on various journal forms.
TICKET.DAT  Ticket data. (Available with Export. Not available in First Accounting.)
UNITMEAS.DAT   V11.5 and later: Unit of measure data.
UPS*.DAT  V12 and later: UPS Shipping information.
UserPref.DAT  V8 and later: PT Today settings.
VENDINS.DAT  V13 and later: Vendor insurance data.
VENDOR.DAT  Vendor data. (Available with Export and DDE.)
WORKTKT.DAT  V11.5 and later: Work Ticket data.