I have an Access database that I am working on, and need to extract the images from a few CommandButtons on a Form and save the images as files.
I haven't been able to do this using VBA. Anyone done this before or know how to do this?
I've used some of the Access built-in images, by using a simple graphics program to capture the screen image, then saving it to whatever format you require (eg bmp etc).
Related
I have a Client that is using MS Access, I need to be able to convert a Base64 String representation of a Bitmap image, so that it can be displayed in an MS Access Report.
I know how to do this is C# etc, but don't know where to start with Access...
The best solution may be to use an external program:
make your own in C# as you know how to do
if you just want to display it you can do it with the user's browser
I am using CK Editor on my web site and have built a simple uploader script in php to add images to my server. I am using the image browser plugin to enable the inclusion of images into my text. The image browser seems to work using a JSON file which must list all images in the image folder.
I am completely new to JSON and to get around learning how to build a JSON file I created a PHP file which simply reads the names of my images from a database and includes them in the JSON file.
This, as a workaround seems to be perfectly functional, however it is reliant on my upload script having to add the image names to the database (an unnecessary step) and it is also bad practice.
I am looking for a good tutorial or explanation on how to make a very simple JSON file which lists the images in my uploads folder in the correct format for CK Editor so that I can free myself from my image names database and program like a big boy.
Any and all help would be apreciated.
Wanted to know if the following scenario is possible -
I have some data that is in an excel file. I want to make an html page which will have this data inside it (no other source of data). And inside the Html page, will I be able to put textfields, buttons etc for a user to input data and based on that, i need to write queries (jqueries i guess) to show the data that is the result of those queries
Can this be done? I have not done anything so far. I just wanted to know if this is possible and please someone point me in the right direction for me to start. I wanna learn on my own how to do this.
Thanks in advance.
HTML is a markup language - it is the structure of a webpage, and has no mechanisms for storing or processing dynamic data.
You will have to use a client-side language JavaScript + cookies, or a server-side language like PHP + MySQL.
You want to look at using JavaScript in the page. On the server (I presume) you need to read the Excel file, and generate JS objects on the page that hold the values. That is, the JS when run creates a collection of JS objects with the values in it. This script can be embedded in the page so that no other data access is needed.
You can then write more JS linked to the buttons that select data out of these objects, and displays them on the page. You probably don't want to do this from scratch -- there are good JS libraries and frameworks to leverage. Consider either GWM or YUI.
Perhaps the simplest way is to open the file in Excel and save it as text (tab-separated; comma-separated would do, too), then insert this text data into your HTML document between the tags <script type="text/plain"> and </script>. You can then write, in a rather straighforward way, JavaScript code that reads the content of this element and constructs a JavaScript array of objects (or some other suitable data structire) from it. It will then be easy to access the data in JavaScript.
This will make it possible to run queries and display data. Modifying the data would be a completely different matter.
I use Access 2007
I have created an OLE field to store JPEG, so I can easily drag them into DATABASE.
That works. Trouble is: This field does not dispaly the JPEG but the generic JPEG thumb and I need to double click to open the JPEG and preview it.
Is there a way to preview JPEG without having to double click on it ?
regards
Have you considered storing your images entries for your database as 'text', and simply store the path for the image(//pics/mypic.jpg), rather than the image object itself? If your database is on a shared drive, you can create a folder in the same folder as your database to hold your images. When inserting an image, you can have a textbox and simply type the relative path to that image. This will prevent your database from inflating in size. From there, it is just some simple code to display the picture.
After setting your database up to just store the path names of the images, you can follow these easy instructions on how to display these images on forms : Microsoft Knowledge Base
I recently switched a couple of my databases from using OLE's to text fields with the path name of the picture and am really satisfied with it.
You will need to use an Attachment data type to display anything other than bmps. Only bmp images will display in an OLE field (see the Northwind sample database for an example, the Employee form shows bmp images stored in an OLE field).
Alternatively, you can store the path to the image and show it in your form with some VBA. In general, it is best to store paths to images, rather than images, even with databases that have much higher size limits.
So I have an excel workbook that has a nice global map of shaperange objects. With some very simple code I can change the colors, group and ungroup collections of countries into arrays, etc...and it works pretty well. However, I would like to bring this into Access.
So I could copy and paste all the shapes into an access form manually, but then they become pictures and I cannot change the colors of the countries (shaperange objects) to have the map act interactively as I can in excel.
So I am thinking that I know how to use excel functions from access, and how to open excel from access. Is there a way to copy an object from excel (I know the file name and the shape name that i mean to copy everytime), and bringing it back to access to paste on a form?
Atypical, I know, all my Access questions are. Thanks!
EDIT:
I would be happy to elaborate my half crazy idea. So I know how to open a new excel instance, or open a template behind the scene (w/o actually making it visible). And I know how to use vba to preform excel tasks, from access modules.....or even run formulas and excel functions from access. i have this interactive map program that works with excel modules, but I would like to make them a part of an access form.
So to answer the below question, if I can just find the missing link with copying and image/shaperange object from excel, and copying it into access form, then I can write code that will always grab the shapes from my excel template format the shapes in excel before copying and pasting into access form, where layout formatting can take place. when a user selects something on a form were I want to include an area of a global map with relative colors/shading, etc...access will always get the pre-defined map pieces it needs from a collection of object in a file/excel template. My idea was after the selection, I would format the shapes, just like I already do with vba, then ole.copy and ole.paste back into the access form. If it is a picture at that point, it doesn't matter. Atleast for the shape itself
lots of code but i think it is worth a try to try to incorporate excel and this shaperange object based map into a form enviroment like the access forms! Pretty strange but it might work well?? Some weird atypical things have become staples in my access database.
Well you're asking this:
"So I could copy and paste all the shapes into an access form manually, but then they become pictures and I cannot change the colors of the countries (shaperange objects) to have the map act interactively as I can in excel.
"So I am thinking that I know how to use excel functions from access, and how to open excel from access. Is there a way to copy an object from excel (I know the file name and the shape name that i mean to copy everytime), and bringing it back to access to paste on a form?"
Maybe some potential responders are asking themselves why if the present solution is not good enough to paste into an Access form because "then they become pictures," but it's okay to Automate the same procedure that you believe is substandard.
Maybe rephrasing the question would help.