Results 1 to 4 of 4
  1. #1
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153

    Create Table with empty OLE Object


    I am creating some small tables from my main database which will be passed to a separate application running on a tablet computer.
    I have found the following simple code works for all my requirements except one:
    Code:
    wOrderInvoice = "tblOrdHead" & strTabletId
    DoCmd.RunSQL "SELECT qryKEFDOrdHead.* INTO [" & wOrderInvoice & "]  FROM qryKEFDOrdHead;"
    DoCmd.CopyObject "N:\DB4Tablet.mdb", wOrderInvoice, acTable, wOrderInvoice
    The query is
    Code:
    SELECT DISTINCT tblTempOrders.InvoiceNumber, tblTempOrders.CustomerName, tblTempOrders.Vehicle, DSum("outstanding","qryCustomerAccountBalance","Customerid=" & [CustomerID]) AS OutstandingBalance, getCDec(0) AS InvoiceTotal, 0 AS OrderStatus, getCDec(0) AS PaymentCash, getCDec(0) AS PaymentCheque, getCDec(0) AS PaymentCard, cdate(0) AS RecDate, getdriver() AS Driver, "" AS CusNotes, "" AS Signature, "" AS signedname
    FROM tblTempOrders
    GROUP BY tblTempOrders.InvoiceNumber, tblTempOrders.CustomerName, tblTempOrders.Vehicle, tblTempOrders.CustomerID;
    Many of the fields are blank as they will be filled in by the tablet application.
    The problem field is Signature - which is curently declared as empty Short Text
    The Signature field needs to be declared as an (emoty) OLE object as the tablet will be used to collect a drawing of a signature.

    So the question I have is how to replace the current -- "" AS Signature -- in this query to create an empty OLE Object??

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    I don't think you can, you should leave the Signature field out of the first query then use an Alter Table statement to add it once you have the table. See this link (towards the bottom) for help:
    https://microsoft.public.vb.general....e-in-ms-access

    https://learn.microsoft.com/en-us/of...oft-access-sql

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    TOPSie is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    153
    THANK YOU - worked like a charm :-)

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 8
    Last Post: 03-20-2022, 02:51 PM
  2. Replies: 6
    Last Post: 09-23-2017, 09:10 PM
  3. Replies: 2
    Last Post: 08-18-2015, 06:45 AM
  4. Replies: 5
    Last Post: 05-25-2011, 02:34 PM
  5. ActiveX componet can't create object
    By quanmay35 in forum Access
    Replies: 1
    Last Post: 05-26-2009, 05:27 AM

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