469,336 Members | 5,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

VBA Draw

Is it possible to draw to the screen using VBA and a form in Access and if so, could someone either point me to a decent tutorial on the subject, a good book containing the subject, or show me some example code for drawing objects such as lines and circles to the screen?
Mar 30 '07 #1
7 9639
Denburt
1,356 Expert 1GB
I know that years ago I did this on a report while on the fly no need to go to design view but for a form things like that become more difficult... I just googled and didn't see anything. Good luck hopefully one of the other posters can help you out.
Mar 30 '07 #2
I googled the issue and also, to my chagrin, yahoo!ed the issue. I found alot on doing this in excel, but none of those seemed to apply to Access functions. Here is what I am trying to do. I have a series of map pages. As it is, when someone adds information to the database about one of the maps, they type in the information, print it out, highlight the affected area, then scan it back in an associate the information with the entered data. (This is many levels of annoying).

What I would like to do is store just the base maps and have perhaps a line and rectangle tool to allow them to mark the affected area. That way they mark the affected area on the screen, then enter the information. The information would then be stored in the database along with a semi-colon delimited memo of the coordinates of the shapes over the affected areas.

At this point, I am thinking I will have to take this problem to VC++.NET to solve it, but if possible I'd prefer to do it in access due to my employers desire to use Access only for this project.
Mar 30 '07 #3
Rabbit
12,516 Expert Mod 8TB
If you just need rectangles and lines you can have a hidden rectangle and line object and then they can type size and coordinate info into textboxes that will resize and move the rectangle/line around on the screen
Mar 30 '07 #4
Denburt
1,356 Expert 1GB
O.K. first when storing images in an MS Access database you are looking at a large baloon effect. For instance an image that may only be 100k will expand your DB by about 10mb due to the wonderfull world of OLE. Remember MS Access has a 2 gig limit once you hit this limit you are lucky if you can recover it.

That said I found an article which may do what you are requesting.

Using the InkPicture control:

http://msdn2.microsoft.com/en-us/library/aa480682.aspx

Good luck let me know if you need more help or how it turns out.
Mar 30 '07 #5
ADezii
8,800 Expert 8TB
I googled the issue and also, to my chagrin, yahoo!ed the issue. I found alot on doing this in excel, but none of those seemed to apply to Access functions. Here is what I am trying to do. I have a series of map pages. As it is, when someone adds information to the database about one of the maps, they type in the information, print it out, highlight the affected area, then scan it back in an associate the information with the entered data. (This is many levels of annoying).

What I would like to do is store just the base maps and have perhaps a line and rectangle tool to allow them to mark the affected area. That way they mark the affected area on the screen, then enter the information. The information would then be stored in the database along with a semi-colon delimited memo of the coordinates of the shapes over the affected areas.

At this point, I am thinking I will have to take this problem to VC++.NET to solve it, but if possible I'd prefer to do it in access due to my employers desire to use Access only for this project.
__1. Create an OLE Object Field in your Primary Table called [Maps].
__2. Link/Embed Map Images *.BMPs into this Field as appriopriate.
__3. Create a Form and set the Control Source of the Map Field to this OLE Object Field that was created.
__4. By dbl-clicking on the Map Images within the Form, the User can activate the OLE Server that the *.bmp opens in, and the User man modify it and save it.
Mar 30 '07 #6
Denburt
1,356 Expert 1GB
4. By dbl-clicking on the Map Images within the Form, the User can activate the OLE Server that the *.bmp opens in, and the User man modify it and save it.
Forgot about that and if I am not mistaken you can even edit it in MS Access too. I tried this but it has been so long I would need to research it or dig up my old db.
Mar 30 '07 #7
Thanks everyone for replying.

Rabbit: I can't use a hidden rectangle because there needs to be the ability to add as many rectangles as the user needs to the page (if they need 5, then they need 5, et cetera). Thank you for the suggestion, however.

Denburt: I know that images will balloon the database. The images are actually just linked into the database via a image objects .picture property. In other words, I don't store the images in the database, just the information about them and, if I can draw the objects to screen that I need, information about those objects. The database is currently 500kb (with a folder with 200MB worth of maps in the same folder as it). Thank you for the warning though, as before I started studying for this database, I was in fact going to load them in. I found a way to do this without ballooning but it required more time than I was willing to put into it.)

The InkPicture control might work, I will give it a try monday morning when I get into work. Thanks for the link (It will help with more than just this project and, considering I am making this database for a group of individuals with tablets, might be just what I was looking for). I will let you know if it works.

ADezii: The individuals that will be working on this are for the most part the antithesis of technically savvy. Editing the base files would be more than they are willing to do. Not only that, but the reason I am attempting to draw rectangles and lines to screen is to save space by not creating many many images (Right now one map page may have 10-15 files with the same file but different information on it, adding up to 15MB worth of GIF per map page). This is not an option as BMPs will balloon the size of the folder (There is only so much server space we are allowed to use). Thank you for the suggestion, however.

All: I think I am going to just code this on my copy of Visual Studio and make it an independent program that links to an access database with the data in it, as the limitations of working with the Access Forms is starting to waste alot of my time and effort to figure out how to do what should be relatively simple things. Thank you everyone for your suggestions, and I will decide what to do when I get into work on Monday (I will also update this post if I find out anything new or find that the InkPicture control works for what I need).
Mar 31 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Matt | last post: by
reply views Thread by Florida Draw | last post: by
5 posts views Thread by Matt | last post: by
2 posts views Thread by dan heskett | last post: by
3 posts views Thread by Daniel Mark | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.