Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Location
    Kansas, USA
    Posts
    3

    Unanswered: Image to default information into form

    Is it possible to take an image that is divided into sections and then click on a certain part of the image and have that information, such as a number, defaulted into a section of a form? I have an image of a county divided into five sections and I want to be able to draw a rectangle around one section and, when it is clicked, it defaults that number into the Location field in the form. Any thoughts? Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    1. Place the image on the form
    2. Place command buttons over the image for your "rectangles."
    3. Adjust the size of the command buttons to cover the sections of your image.
    4. Use the OnClick events to assign the appropriate value to the Location field.
    5. Set the Transparent Property of each command button to Yes.
    Last edited by Missinglinq; 08-04-09 at 01:47.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Aug 2009
    Location
    Kansas, USA
    Posts
    3
    That's what I figured I could do a rectangle but I can't figure out any of the code. I'm not the great at it, but do you have any suggestions of where I could learn how to? Sorry to bother.

    EDIT: Would it have anything to do with

    rsWrite.Fields("Estop").Value = 1
    rsWrite.Update

    ?
    Last edited by RTaylor09; 08-04-09 at 17:40.

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You can't really use rectangles for this. They have an OnClick event, but you have to click exactly on their frames, which is difficult to do. Clicking inside of the rectangle doesn't do it!

    So using command buttons, and naming them ControlSectionOne, ControlSectionTwo, etc. you can use code like this:

    Code:
    Private Sub ControlSectionOne_Click()
     Me.LocationTextbox = 1
    End Sub
    
    Private Sub ControlSectionTwo_Click()
     Me.LocationTextbox = 2
    End Sub
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Aug 2009
    Location
    Kansas, USA
    Posts
    3
    Ok, now is there someway to change the Me. part to the name of another form?

    EDIT: So I have a form where I type in all the info, then a button on that form that opens another form with an image. I want to put buttons over that image so when I click on the button it auto fills a specific number into a value list box on the first form.


    Sorry I don't know much.
    Last edited by RTaylor09; 08-04-09 at 23:12.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Forms![FormName]![ControlName] is how you refer to a control on another form.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •