Results 1 to 9 of 9
  1. #1
    joanne2468 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Kansas
    Posts
    9

    Question Inserting a box in Access form that you can draw on with a stylus

    Is it possible to insert a box of some sort in an Access form that will allow someone to draw an object with a stylus or with their finger? The drawing object would need to be stored as part of data in the form.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    99.95% No
    0.05% is reserved because I never say never.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    274
    Since this code can be run on Internet Explorer:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    
        <style>
    body {
       background: #e74c3c;
    }
    
    #canvas {
       position: relative;
       left: calc(50% - 390px);
       top: 50px;
       border: 1px dotted black;
       cursor: crosshair;
       background: #ecf0f1;
    }
        </style>
        <script>
        var canvas;
    var context;
    
    window.onload = function() {
       canvas = document.getElementById('canvas');
       context = canvas.getContext('2d');
       canvas.width = 780;
       canvas.height = 490;
       context.strokeStyle = "#913d88";
       context.lineWidth = 2;
       
       canvas.onmousedown = startDrawing;
       canvas.onmouseup = stopDrawing;
       canvas.onmousemove = draw;
       
       function startDrawing(e) {
          isDrawing = true;
          context.beginPath();
          context.moveTo(e.pageX - canvas.offsetLeft, e.pageY - canvas.offsetTop);
       }
       
       function draw(e) {
          if (isDrawing == true) {
             var x = e.pageX - canvas.offsetLeft;
             var y = e.pageY - canvas.offsetTop;
          
             context.lineTo(x, y);
             context.stroke();
          }
       }
       
       function stopDrawing() {
          isDrawing = false;
       }
       
    }
        </script>
    </head>
    <body>
        <canvas id="canvas"></canvas>
    </body>
    </html>
    Then it can be done with the browser control. I grabbed that code from https://codepen.io/nDav/pen/xGBBVW

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by joanne2468 View Post
    Is it possible to insert a box of some sort in an Access form that will allow someone to draw an object with a stylus or with their finger? The drawing object would need to be stored as part of data in the form.
    I believe you can. I seem to recall @isladogs produced something to do that.

    Found it.
    https://isladogs.co.uk/signature-capture/index.html
    Last edited by Welshgasman; 04-24-2023 at 07:47 AM.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    You can indeed do this within Access, either to insert a signature, enter text by hand or indeed as an Etch a Sketch!
    No need to use a browser control for this purpose.
    See the link to my article that @Welshgasman posted above.

    Good job @Micron reserved 0.05% for doubt!
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I learn something new each day. Too bad it doesn't seem to be something I can recall tomorrow.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Micron View Post
    I learn something new each day. Too bad it doesn't seem to be something I can recall tomorrow.
    LOL. I'm lucky if I remember in an hour's time.
    I've given up answering questions where I don't know as I'm so often proved wrong - hence my signature below
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have older laptop without touch screen. Mouse can write in box but of course result is less than ideal. Doesn't seem to be a USB or wireless stylus as input device (like a mouse) for non-touch screen. Would have to connect a drawing tablet for input by stylus. Lowest price I see on Amazon is 16.99.
    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.

  9. #9
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

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

Similar Threads

  1. Draw line between 2 sub reports
    By jc_msa in forum Reports
    Replies: 7
    Last Post: 02-03-2023, 04:02 AM
  2. Replies: 10
    Last Post: 10-14-2019, 10:08 AM
  3. How to draw a vertical line on a sub form
    By hassan.tajdar in forum Forms
    Replies: 4
    Last Post: 05-09-2017, 08:47 PM
  4. Replies: 3
    Last Post: 02-11-2015, 05:41 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