Results 1 to 6 of 6
  1. #1
    amallon is offline Novice
    Windows 8 Access 2007
    Join Date
    May 2015
    Posts
    7

    Pasting a picture into a record on a form

    We have a production system where we print pictures to canvas. The printers run 24/7 so in the morning there is a pile of prints that need cut and framed. Some of these have been purchased with express delivery and need to be found and sorted first. I want a form where I can paste in a picture of the picure thats to be frame along with the persons name/ordernumber. This will then be displayed on a 50" TV in the production area. Any good suggestions on how to do this?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Tell us about your production system with respect to Customers, Orders, PrintJobs etc.
    Do you really want/need a separate system? Will these be expected to communicate?

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    This method could cause the db to fill up past the limit.
    The better way is to store the PATH to the photo. (photos would be stored say JPGs in a folder)

    Then the form can show the photo by opening it in its native app. (browser, or Jpg viewer, whatever is default for .jpg)
    OpenNativeApp txtBox

    the text box , in the field , would show : c:\photos\wedding\Imag1.jpg
    the routine, OpenNativeapp opens the file.


    Code:
    '
    Paste this code into a module, and it will open ANY file in its native application.
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    Code:
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Const SW_SHOWNORMAL = 1
    Const SE_ERR_FNF = 2&
    Const SE_ERR_PNF = 3&
    Const SE_ERR_ACCESSDENIED = 5&
    Const SE_ERR_OOM = 8&
    Const SE_ERR_DLLNOTFOUND = 32&
    Const SE_ERR_SHARE = 26&
    Const SE_ERR_ASSOCINCOMPLETE = 27&
    Const SE_ERR_DDETIMEOUT = 28&
    Const SE_ERR_DDEFAIL = 29&
    Const SE_ERR_DDEBUSY = 30&
    Const SE_ERR_NOASSOC = 31&
    Const ERROR_BAD_FORMAT = 11&
    
    Public Sub OpenNativeApp(ByVal psDocName As String)
    Dim r As Long, msg As String
    r = StartDoc(psDocName)
    If r <= 32 Then
        'There was an error
        Select Case r
            Case SE_ERR_FNF
                msg = "File not found"
            Case SE_ERR_PNF
                msg = "Path not found"
            Case SE_ERR_ACCESSDENIED
                msg = "Access denied"
            Case SE_ERR_OOM
                msg = "Out of memory"
            Case SE_ERR_DLLNOTFOUND
                msg = "DLL not found"
            Case SE_ERR_SHARE
                msg = "A sharing violation occurred"
            Case SE_ERR_ASSOCINCOMPLETE
                msg = "Incomplete or invalid file association"
            Case SE_ERR_DDETIMEOUT
                msg = "DDE Time out"
            Case SE_ERR_DDEFAIL
                msg = "DDE transaction failed"
            Case SE_ERR_DDEBUSY
                msg = "DDE busy"
            Case SE_ERR_NOASSOC
                msg = "No association for file extension"
            Case ERROR_BAD_FORMAT
                msg = "Invalid EXE file or error in EXE image"
            Case Else
                msg = "Unknown error"
        End Select
    '    MsgBox msg
    End If
    End Sub
    

    usage: OpenNativeApp txtBox

    OpenNativeApp "c:\folder\file.pdf"

    will open it in acrobat
    OpenNativeApp "c:\folder"
    will open the folder

    OpenNativeApp "www.google.com"
    will open web browser.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Can't copy/paste image into record or on form.

    Either embed image into Attachment field (use its intrinsic navigation dialog to locate file) or save image path string into text field (use system FileDialog code to locate file). I normally do the latter. Then use Image control on form bound to field to display image.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    you can Paste image into a form IMAGE object.
    (but you could fill up the db after a while)

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    I tried pasting from clipboard into a bound and unbound Image control. Not successful.

    Exactly how do you accomplish?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 05-23-2020, 05:07 PM
  2. Replies: 1
    Last Post: 05-27-2019, 11:51 PM
  3. Replies: 2
    Last Post: 05-28-2013, 12:32 PM
  4. Copy and pasting data in form view help
    By Ash1402 in forum Forms
    Replies: 8
    Last Post: 10-13-2012, 12:36 PM
  5. Replies: 1
    Last Post: 08-27-2011, 06:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums