Box to Default Info

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RTaylor1853
    New Member
    • Nov 2008
    • 15

    Box to Default Info

    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!
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Yes. It should be. You need to use the OnClick event to handle assigning the correct number to a separate control.

    You're going to have to give some more detailed information if you want more detailed help of course.

    Comment

    • RTaylor1853
      New Member
      • Nov 2008
      • 15

      #3
      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

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        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

        • RTaylor1853
          New Member
          • Nov 2008
          • 15

          #5
          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 2003

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            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

            • RTaylor1853
              New Member
              • Nov 2008
              • 15

              #7
              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

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                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

                • RTaylor1853
                  New Member
                  • Nov 2008
                  • 15

                  #9
                  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 above
                  Last edited by RTaylor1853; Oct 13 '09, 03:01 PM. Reason: Added more clarity

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32633

                    #10
                    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

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32633

                      #11
                      The Click event procedures for the various Command Buttons is where you need to set the code. I've done the first one for you as an example :
                      Code:
                      Private Sub CommandButton1_Click()
                          Forms![EMS RUN INFO].Location = 1
                      End Sub

                      Comment

                      • RTaylor1853
                        New Member
                        • Nov 2008
                        • 15

                        #12
                        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

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32633

                          #13
                          The answer's Yes.

                          The question is "Where did that come from?"

                          Is this even related?

                          Comment

                          • RTaylor1853
                            New Member
                            • Nov 2008
                            • 15

                            #14
                            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

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32633

                              #15
                              Ah, I see. That makes sense now.

                              To look at the question again then :
                              Originally posted by RTaylor1853
                              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?
                              The answer is only "yes" because the first part (in bold) makes it so. It's possible to reference and control objects from one form, from another. This is what we have in your example after all.

                              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

                              Working...