User Profile

Collapse

Profile Sidebar

Collapse
Hennepin
Hennepin
Last Activity: Jun 5 '15, 02:45 PM
Joined: Oct 2 '09
Location: Finger Lakes
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I have been using the same code for years but modified it slightly to print.

    Code:
    Public Function fHandleFile(stFile As String, lShowHow As Long, Optional doprint As Boolean = False)
    Dim lRet As Long, varTaskID As Variant
    Dim stRet As String, stoperation As String
        stoperation = vbNullString
        If doprint Then stoperation = "print"
        'First try ShellExecute
        lRet = apiShellExecute(hWndAccessApp,
    ...
    See more | Go to post

    Leave a comment:


  • Change the Default property of command button to yes.
    Then when you hit enter the command button will execute even if it does not have focus or a tab stop.
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to Bat file returns running status in VBA
    In my project I am just reading the dump of license status from an executable. If it fails I have an empty string. So i know it failed.

    I am assuming in your case the bat file does not return anything. So if it fails you need to have the std error returned so the optional blnStdErr needs to be true.

    Code:
    FileName = CurrentProject.Path & "\Request_Budget_Expenditure\Request_Budget_Expenditure_run.bat"
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to Bat file returns running status in VBA
    NeoPa
    I realized both of your points as I was going home from work last night.
    I will fail if it can't run the bat file but will not report what the bat file returns.
    The code below will return the ouput of the bat file.
    Been using it for about 10 years in VB6 and VBA.

    sophannaly
    The code below will return any screen dump to the cmd window in a string.


    Code:
    Option Explicit
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to Bat file returns running status in VBA
    If the function CreateProcessA succeeds, the return value is nonzero.
    If the function fails, the return value is zero. To get extended error information, call GetLastError.

    I have code that dumps the ouput of a command into a string, which I could post if you want.

    Code:
    'Start the shelled application:
    if CreateProcessA(lpApplicationName:=0&, _
    						lpCommandLine:=strCommand, _
    						lpProcessAttributes:=0&,
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to Import XML File to a MS Access Table
    This topic is fortuitous for me. I just started to create a module for input and parsing an xml file.
    I got the xml loaded into objects in memory now I need to extract data from it. I am going to study xmldom at ‘A Beginner's Guide to the XML DOM’ at http://msdn.microsoft.com/en-us/library/aa468547.aspx to see if this will make it easier.
    I believe the library reference to msxml is 'Microsoft XML, v6.0' (this is latest version on...
    See more | Go to post

    Leave a comment:


  • I wrote this code several years ago to down load baseball stats from espn. It reads one character at a time.
    saves the output into a comma seperated file.
    You can tweak it to your needs.

    Have a reference to microsoft scripting runtime for file system object.

    Code:
    Option Compare Database
    Option Explicit
    
    Enum RdProcess
        tableout
        tablein
        tagin
        tagout
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to How to generate report to a pdf format
    I use this in my 2007 access database to put pdf's of my reports on the network.

    Code:
        DoCmd.OpenReport  report_name, acPreview, , , acHidden
        DoCmd.OutputTo acOutputReport, report_name, acFormatPDF,  filename  , True
        DoCmd.Close acReport, report_name, acSaveNo
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to change forecolor onpaint - bug?
    I set up a form to test 'On Paint' and got the same results in Access 2007. So I added 'On Enter' event for the control. It seemed to work well except there is a flicker as it repaints.
    Also played with the detail back color. This could be useful.

    Code:
    Private Sub Detail_Paint()
        If Me.IEC Then
            Me.Gage.ForeColor = RGB(237, 28, 36)
            Me.Detail.BackColor = RGB(0, 250, 255)
        Else
    ...
    See more | Go to post

    Leave a comment:


  • In the property sheet for button change On Click to =clear_filterLi st() or what ever name you choose.
    and for the combo boxes change AfterUpdate to =filterList().
    In the button tag property put the name of the combo control the button clears in.
    You have to change the subs to functions.
    Code:
    Private Function filterList()
       'your filter   
    End Function
    
    Private Function clear_filterList()
    ...
    See more | Go to post

    Leave a comment:


  • Yes there is a setting. Its in the form properties called GridX and GridY.
    The default for inches is 24 subdivisions per unit of measurement.
    Use access help on these properties to get more info on it.
    The smallest increment that an object can be located is 1/96 of an inch.
    So your object is moving 3/96 of an inch = .0313
    I did not check if units were metric what the division would be.
    This was in Access...
    See more | Go to post

    Leave a comment:


  • I prefer using the file system object
    Code:
        Dim FSO As Object
        Set FSO = CreateObject("scripting.filesystemobject")
        FSO.MoveFile "c:\rt\rfidlogs\*.out", "c:\rt\rfiderrors\"
    or with reference set to 'microsft scripting runtime' then IntelliSense will work
    Code:
        Dim fs As New FileSystemObject
        fs.MoveFile "c:\rt\rfidlogs\*.out", "c:\rt\rfiderrors\&
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to Printing two reports on one page
    Make a report with your 1/2 sheet report as a sub-report twice.
    Need to move you Page Header and footer section information to the Report header and footer section, because the page header and footer does not show up in a sub report.
    See more | Go to post

    Leave a comment:


  • Wrap the string with ; with quotes.
    Code:
    Me.List0.AddItem """I am a coder;The best one !"""
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to How to know if a pdf file does not exist
    The code will work correctly until you have a differnt version of Adobe reader or it is not installed in the default place.
    Using your method of opening a pdf.
    You could check the return on shell and suppress the error message from shell
    Code:
    Dim varFile As String
    Dim varFile2 As String
    Dim retval
    On Error Resume Next ' prevent error message from Shell
    If Right(Me.JobPlanFolder, 5) = "\.pdf"
    ...
    See more | Go to post

    Leave a comment:


  • I do not believe there is an interface for creating a ribbon in Access 2007. I use the system table ‘USysRibbons’ method of loading ribbons, described in this link http://www.accessribbon.de/en/?Access_-_Ribbons
    I am guessing by description you mean label. the XML code for creating a button with a label is
    Code:
    <button id="MybuttonID" label="My Label" screentip="My Screen Tip" onAction="MyOnActionB
    ...
    See more | Go to post

    Leave a comment:


  • make a table called USysRibbons
    with two fields
    RibbonName Text key field
    RibbonXML Memo

    Need one record and in memo field place xml code
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    </ribbon>
    </customUI>
    The table will be hidden unless you have 'show system objects' checked...
    See more | Go to post
    Last edited by NeoPa; Nov 2 '11, 03:01 PM. Reason: Added mandatory [CODE] tags for you

    Leave a comment:


  • I have Access 2007 but this worked for 2000. Set a reference to the Microsoft Office 12.0 Object Library. The 12.0 will change depending on version. I believe the function only needs to be run once and the menu will be stored with your database. Set ShortcutMenuBar property of the control to name of command bar. It should be in a drop down list in design view.
    Then enable disable as ADezii stated.

    Code:
    Option Compare Database
    ...
    See more | Go to post

    Leave a comment:


  • Hennepin
    replied to A dynamic ribbon dropdown?
    What ever triggers to change your query will change a variable (cmbTDEngGroup in the example code) that can be seen by your ribbon callbacks. Then need to invalidate the control forcing it to reload'

    Code:
    Public gobjRibbon As IRibbonUI
    Dim comboLabels() as string
    
    ' Callback Count of items and fills in items into arrays
    Sub RibbonCBGetItemCount(control As IRibbonControl, ByRef count)
    
        Dim i
    ...
    See more | Go to post

    Leave a comment:


  • I have started a database to help with genealogy this is how I have set up my tables for family and individuals.

    Table: Individuals
    ind_Id Key
    ind_name
    ind_surname
    ind_gender

    Table: Family
    fam_HusbID key linked to ind_Id
    fam_WifeID key linked to ind_Id
    fam_ID unique foreign key to fc_FamID

    Table: Family_Chidren
    fc_FamID key
    fc_IndID...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...