Results 1 to 3 of 3
  1. #1
    DDS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2018
    Posts
    24

    Solution to dual application VBA settings

    Hi,


    I'm wondering someone might be able to offer a better solution for my situation.
    Myself and a client who I'm building an Access database for, use a program called CorelDraw (for graphic design).
    The CorelDraw UI can be customised somewhat with VBA (quite handy).
    I have created an export feature in both my own and my client's CorelDraw Workspace which exports the current CorelDraw drawing to jpg files placing them into various folders at different resolutions as well as saving an extra copy of the CorelDraw file to 1 or 2 other directories. This is all done using VBA code in a module stored with CorelDraw.

    It occurred to me that I could give my client (and myself) the ability to adjust the jpg resolutions and directories where these jpg files export to using a form in our individual Access databases rather than hard coding all this into the module inside CorelDraw.

    My current idea is to use various SaveSetting statements in the Access form to store the desired directory paths and jpg resolutions, and then use some GetSetting statements in the CorelDraw module to retrieve this info when the 'Export' button is clicked in CorelDraw. This info would also be stored in a table in the Access database for later reference and modification if the need arose.
    I believe I could make this work but I'm wondering if there is a better way? This way seems a little 'clunky' to me.
    Particularly given that I would prefer to give the user the ability to create as many exports as they desire and also the ability to alter these at any time which would mean I may end up with redundant registry files building up as the user makes changes over the years. Also I'm not sure how I would loop through registry files to check their existence.
    To get around the looping through registry files I thought I'd probably append a sequential number to the 'key' argument in the SaveSetting statement for each jpg export and then create another SaveSetting file indicating how many files to loop through at the Corel end. However this has the potential to leave unused registry files if the user reduces the number of exports. Doesn't feel like a very elegant solution.

    As far as the number of registry files being created goes, the VBA function used to export the drawings in Corel (for my purposes) just requires 2 x variable inputs - path of folder and a number indicating the width of the final jpg file in pixels.
    The number of jpg exports done will be somewhere around 2 or 3 plus 1 or 2 Corel File saves which only need the folder path variable so the total number of registry files I'd need to create using this method might be in the region of 6 to 9 typically.

    Is there any way to retrieve data from a table in a closed database using VBA code written in a module of a different application?
    Or can this info be stored in some other type of file which can be read from both programs using VBA?
    Or am I being a bit precious and my SaveSetting method is ok?
    Thanks for reading.

  2. #2
    DDS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2018
    Posts
    24
    I'm going to call this solved even though I didn't get any other suggestions. I persevered with the SaveSetting idea and it's working fine.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,782
    Or can this info be stored in some other type of file which can be read from both programs using VBA?
    One thought is to write the data from the Access database to a txt/csv file that Access and CorelDraw have R/W permissions.

    Is there any way to retrieve data from a table in a closed database using VBA code written in a module of a different application?
    You might be able to use DAO to open an Access database from CorelDraw to R/W Access data. Might have to set up an ODBC connection.
    There are ODBC drivers to connect to SQL Server, dBase, VFP, Excel, Text files,.....

    Also check into ADO. If DAO won't work, I would be surprised if ADO wouldn't be able to read Access data. (I haven't used ADO but once - something I need to learn more about.)



    I did a little reading on "SaveSetting" because I had never heard of "SaveSetting"/"GetSetting"/"DeleteSetting" statements...
    Personally, I would be leery about writing to the Registry.


    Good luck with your project......
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

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

Similar Threads

  1. Forms - Dual Language Support - Help Needed
    By BaldPlumber in forum Forms
    Replies: 5
    Last Post: 05-14-2017, 08:47 PM
  2. Dual Column Comboxbox
    By dotcanada in forum Access
    Replies: 6
    Last Post: 10-13-2016, 03:48 PM
  3. Similar to DUAL in Oracle
    By orange in forum Sample Databases
    Replies: 2
    Last Post: 04-30-2016, 08:18 AM
  4. Filter dual-column combo box
    By lisa071 in forum Forms
    Replies: 1
    Last Post: 03-31-2015, 12:18 PM
  5. Dual language message box
    By Derrick T. Davidson in forum Programming
    Replies: 1
    Last Post: 07-10-2013, 07:11 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 - Senior Forums