Is it possible to implement a form that does this?

UnhandledException

Registered User.
Local time
Today, 15:13
Joined
Dec 11, 2009
Messages
15
I am looking to build a Form in Access that looks something like the image shown below.

The 3 fields and the button are easy, its the larger field on the Form that is difficult.
This large field should have the entire area available and have a background "similar" to what you see. Then when ever the user clicks within the space a dot appears. (The size and color isn't a concern for now.)

As far as being able to edit the image after committing or moving the dot after it appears are all extra goodies but isn't too much of a concern at the moment. Right now I have no idea where to begin.

Any help/direction would be much appreciated.

SampleAccessForm.jpg
 
I suppose you could, but it will be quite troublesome.

One problem is figuring out where the mouse is positioned when it was clicked then placing the dot on the same position is going to be quite involve and almost certainly will require API calls into figuring the screen resolution, the form's window's X/Y position and then calculating the offset to that field and using MouseMove event to update the mouse's position so when you have a good idea of where the cursor was when Click event is fired.

If you are willing to bend a bit, it may be more practical to have two more unbound textbox to act as input for X & Y coordinate and you can just have the user enter the coordinate and have the dot appear in the relative position. You can then add mouse-click stuff in later.

An alternative is to check if there exists a .NET solution that supports the desired functionality and then write a COM interop library for Access to call into and when the user is done with the .NET form, close the form and return an array of the dots that user has clicked and its coordinates.

Hope this gives you some ideas...
 
Thanks for the reply.
It looks like I may have to take it a step at time.
Any input as to what type of field this should be?
Can I bind that field to some free area or maybe something like Paint so that if it is double-clicked then Paint opens to create/edit the image?
Then when Paint is saved it would propagate the changes back to the field and into the Database.
 
I think it is all doable directly from within Access but it’s a lot of code.

1. Are you reasonably good with VBA?
2. Can you maintain the code?
3. Is it to run as an MDE file?
4. How many Dot images do you need? (Must be < 700)
5. Do the images require an attached label? (Must be included in the < 700 total)
6. Can you supply the Dot image with transparent background?
7. Can the Dot image be used in an Access image control?
8. Do you have an image editor that can be hyperlinked to with the image argument?
9. Do you require drag, drop and resize of the images?
10. Do you require snap to grid for the images?
11. Does the background grid have time or distance units?
12. Are they the same both horizontally and vertically?
13. Do the grid units need to be changed on drag/drop of the background grid?
14. Will the images and background, as a group, constitute one set of images?
15. Will there be more than one set of images?
16. Do you also need a report of one set of images?
17. What is it being used for?
 
1. Are you reasonably good with VBA? Yes, no, well maybe. I have a programming background and it has been a while since working with VBA code, but have done so in the past.

2. Can you maintain the code? Yes

3. Is it to run as an MDE file? If this is the run-time version of the application then yes, eventually if I opt to pass it along to a few friends, but mostly building for my own use.

4. How many Dot images do you need? (Must be < 700) Probably no more than 10 dots, probably 20 or 50 at the very max.

5. Do the images require an attached label? (Must be included in the < 700 total) No, I am assuming the field itself would be treat as a single entity regardless of the number of dots.

6. Can you supply the Dot image with transparent background? A transparent background is not desirable but is acceptable.

7. Can the Dot image be used in an Access image control? Once the image is created (dots placed on the background) then yes it could be stored in an image control.

8. Do you have an image editor that can be hyperlinked to with the image argument? Since its a basic functionality I was thinking even Paint would be acceptable.

9. Do you require drag, drop and resize of the images? Not really necessary but if its easily incorporated it would be a nice feature to ensure the dot is placed in the proper position. To simply it, even once the use clicks then that is it, the dot is there with a fixed size.

10. Do you require snap to grid for the images? Nope.

11. Does the background grid have time or distance units? This would be desirable but not mandatory.

12. Are they the same both horizontally and vertically? If you are referring to the grid/distance units then yes.

13. Do the grid units need to be changed on drag/drop of the background grid? No, I would have them fixed to help keep things simple.

14. Will the images and background, as a group, constitute one set of images? Yes, a group of dots would essentially be a single object.

15. Will there be more than one set of images? No, one image per record.

16. Do you also need a report of one set of images? Not sure what you mean by report of the one set of images.
 
Nicely answered, especially since you left out question 17. :D

Attached is a drag and drop demo using Labels.
It should also work for Image controls.

I’ll leave it up to you to convert it to handling Image controls rather than Labels.
(Reduce the number of Image controls to what you think is required then double it.)

When that’s done, post it back (A2K3 version please) and we can then proceed.

Regards,
Chris.
 

Attachments

Thanks, that form appears to have lots of potential.

I am still getting used to the 2007 interface and relearning Access so it took a bit to find what was really going on between the form and data being saved in the tables. But this does indeed give me a place to start.

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom