Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text bok link (2000)

    Is there a way to make a text box a link to another form? I have set the properties of the text box to match a label.
    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text bok link (2000)

    You can set the Control Source property of the text box to

    =[Forms]![OtherForm]![ControlName]

    where OtherForm is the name of the form you want to link to and ControlName is the name of the control you want to display the value of.

    Note: this will cause the text box to display #Name if the other form is not open.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text bok link (2000)

    Thanks Hans, the date function works.
    What I am trying to do is create a calendar where each date can be updated by changing the starting date from an invisible date. So I have all that created, but I need to be able to link each date to the correct form. I have each date set up as a text box with the properties set so the user cannot edit the date. Will I still be able to make a link?
    Brandon

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text bok link (2000)

    Formulas of the form =[Forms]![SomeForm]![SomeControl] will work as long as the form referred to is open; it doesn't matter if the form or the control is invisible.

  5. #5
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text bok link (2000)

    I can't seem to make it work. In the control source I currently have =Day([txtstartdate]). The form I want to go to is call JanWeek1. Should the control source now say =[Forms]![JanWeek1]![=Day([txtstartdate])]?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text bok link (2000)

    No, the expression should calculate the day of the value of [Forms]![JanWeek1]![txtStartDate], so it should be

    =Day([Forms]![JanWeek1]![txtStartDate])

  7. #7
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text bok link (2000)

    I see. I think I worded my question wrong. I want the text box to be an actual hyperlink to another form. Is that possible? I can do it with a label, but then I can't make my label do the calculation I need.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text bok link (2000)

    I'm afraid I don't understand what you want. Perhaps somebody else can pick up on this, for I will be offline for the next 60 hours or so.

  9. #9
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Text bok link (2000)

    As Hans is off-line for a few days, I'll see if I can help. If I understand, you are trying to open different forms based on the value of a text box. That can certainly be done, but how many different forms can you have - Access does have an upper limit. I suspect you may be trying to solve a problem using brute force (designing a separate form for each case) when you might with a bit of work be able to modify a form on the fly and make it look like you are using different forms, but only have one. Am I more or less on target?
    Wendell

  10. #10
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text bok link (2000)

    Here is what I have. I created a form that has a 2005 calendar on it. Each day is a textbox which derives the date from a hidden date. This way the calendar can easily be updated for future years. The properties of the text box are set to make it seem like a label. This way the user cannot edit the date. However, I do want them to be able to click the date and bring up another form. You are correct. I will have around 60 forms. Is that too many? I need a form for each week of the year. They will be identical, except for the dates across the top. Right now, I just created a label next to each week that the user can click. It works, but it would be nice if they could click on the actural date number.
    Thanks.
    Brandon

  11. #11
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Text bok link (2000)

    Are you going to have 60 forms for 2006 too? That sort of design usually ends up being a maintenance nightmare. If the forms are identical, why not just set the dates at the top of the form for that week when you open the form to display it. That would involve using some simple VBA commands for each date to invoke procedure to setup the single form when it opens. It is a bit ugly as each date on the calendar would need to invoke the VBA procedure, but I would much rather do that than maintain 60 (or 240) forms. You can make a text box look like a label by simply locking it and disabling it so it cannot be edited. Hopefully this gives you a few alternative ideas.
    Wendell

Posting Permissions

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