I have two forms. The first form is Stats and the second form is just an image of a map. I have drawn boxes and set them as transparent over the map and I want to be able to click on the image and have a number associated with that region of the map to be insert into another field on the Stats form. I know no coding and was just trying to see if this is possible? Any ideas? Thanks!
Box to Default Info
Collapse
X
-
Tags: None
-
I have the boxes drawn on the map on Form 2. The map is divided up into 5 regions. If the incident happened in the 1 region, it would be nice to click anywhere in that region and the 1 would be inputted into the Location field of Form 1. Or if it happened in region 5 then click on 5 and it's inputted into Form 1 Location as 5. Does that help?Comment
-
Actually, if by "I have drawn boxes and set them as transparent over the map" you mean that you've drawn boxes using the Rectangle Tool then the answer would have to be no. The OnClick event of this drawn control fires when you click on the lines that make up the box, not when you click inside of the lines of the box. Clicking exactly on a line is precarious enough to do when you can see them. Doing so when the lines are transparent would be impossible.
You need to use the same strategy but use command buttons instead. They, too, can be set transparent, and placed and sized as you wish, just like you did with your box. But clicking anywhere on the button will fire the OnClick event, which, as NeoPa said, you'll have to use to do whatever it is you need to do.
Also, as NeoPa said, you'll have to give us more details in order to get more detailed help.
Welcome to Bytes!
Linq ;0)>Comment
-
Ok, so to do list, change rectangles to command buttons, but I guess I'm lost on what more information need to be given. Sorry. I just jumped into this feet first and I'm hopeing to land on my feet, but if not oh well. Ummm. it's microsoft access 2003Comment
-
That's fine. We understand. At least you're talking. Communicating. We can always work with that.
Start off by getting the names of all the objects. Include with each object it's type and purpose. That should include all (both) forms. All controls on them.
I think we can work from those details. If we find otherwise we'll let you know.
Welcome to Bytes!Comment
-
Well, let's hope this thing doesn't have a text limit:
FORM 1 - EMS RUN INFO
Account Number - Text - Account Number of patient
Patient Name - Text - Name of patient
Medical Record Number - Text - medical record number of patient
EMS Run Number - Text (Primary Key) - EMS Run Number
Unit Nmber - Text - Ambulance Number
Incident Address - Text - Incident Address
Caller - Text - Caller requesting EMS
Recieved Date - Date/Time - Date call came in
Recieved Time - Date/Time - time call came in
Dispatched Date - Date/Time - self-explanitory
Dispatched Time - Date/Time - self-explanitory
Respond Code - Text - How they responded
En Route Date - Date/Time - en route date
En Route Time - Date/Time - en route time
Nature of Call - Text - Why they are going
Triage code - text - triage code
Destination - text - where they are going
return response code - text - how they came back
Arrive Scene Date - date/time - when they got there
Arrive Scene Time - date/time - when they got there
Leave Scene Date - date/time - when they left
leave scene time - date/time - when they left
transport priority - text - how they transported
arrived destination date - date/time - when they got there
arrived destination time - date/time - when they got there
Location - text - where
type - text - what kind of run
inservice date - date/time - when they were avaiable again
inservice time - date/time - when they were avaiable again
driver - text - who drove
tech 1 - text - who teched
tech 2 - text - who teched
mileage - number - how many miles they went
MD Ctl - Yes/No - if there was a Dr. on the bus
scene location - text - where they went
chief complaint - text - why they went/what was wrong with patient
disposition - text - what happened to patient
charge to charge 21 - text - what supplies they used on the patient
qty to qty 21 - text - how many of each charge they used
LoginName - text - controlled with a macro - displays the current person logged into the system and logs it with that specific run
Agency/Call - text - who called in for the bus
FORM 2 - county
Just a form with no table associated with it
Image0 - Image - what is use to determine what region of the county and the number is picked according.
CLOSE - button - general button that you obtain from the toolbox toolbar used to close the form.
Hope this is what you're asking for.Comment
-
I should have explained that a little better. My bad. I meant relevant objects. Having all is not aproblem though. What I do need to know though, is which item you want set to what when the operator clicks within an area on the map?
What you need to start doing anyway, is to add some more CommandButton controls onto your [County] form (broadly speaking in line with Linq's suggestion earlier). These controls should be set up in size to match the areas you want to specify over your map. They should be set to Transparent, so that they are not seen by the operator (you can set the border if required so they can be seen without obscuring the map too much).
When you've indicated which control on [EMS RUN INFO] you want to be effected we can look at the code required to support this.Comment
-
No problem, I was at work when I typed all that so it gave me a chance to ignore anything else that needed to be done :D.
The item I want set is the Location - text field on the [EMS RUN INFO] form to the corrosponding number clicked on the [county] form.
so like commandbutton1 = region one on map - when clicked it will default 1 into the location field on EMS RUN INFO form
commandbutton2; when clicked on county form, will default a number 2 into the location field on EMS RUN INFO
command buttons3,4,5 to do the same as aboveComment
-
While I'm looking at the code (references to external form controls is the trickiest part generally - See Referring to Items on a Sub-Form), I'll just post a quick suggestion for added flexibility :
You can set up multiple CommandButton controls to return the same region code. This way the regions don't need to be specified exactly as simple rectangles.Comment
-
Whew, thanks everyone for all the help. Really couldn't have done it without you. So anytime you're adding a form within a form and you're wanting to control one to another you have to establish a SubForm control?Comment
-
To your post:
While I'm looking at the code (references to external form controls is the trickiest part generally - See Referring to Items on a Sub-Form).Comment
-
Ah, I see. That makes sense now.
To look at the question again then :
Certainly though, if you want one form embedded within another, it can only be done by using a SubForm control.
I hope that clarifies the issue fully.Comment
Comment