• Using If…Then…Else statement for setting tab

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Using If…Then…Else statement for setting tab

    • This topic has 2 replies, 2 voices, and was last updated 24 years ago.
    Author
    Topic
    #354304

    I have a tabbed control with two groups of reports. Whenever I open a report located on the second tab, then close the report, the tabbed control defaults to the first tab. I’d like to create an If…Then…Else statement to force the tabbed control to set the focus on the tab that the report was opened & closed.

    Can anyone help?

    Thanks in advance.

    Viewing 0 reply threads
    Author
    Replies
    • #520323

      Brent:

      Once you choose to open the report, are you closing the form, then re-opening it after the report is closed? If so, you might try simply setting the visble property of the form to False when you open the report, then set the form’s visible property back to True when the report is closed; this should maintain the focus on the tab you want.

      Regards,

      • #520357

        Shane,

        Thanks for your suggestion. My friend also pointed out that my logic was flawed — I can’t use If…Then in order to perform this anyway grin.

        Yeah, my form get closed after I open the report and after you suggested the visible property, I realized that that was an alternative method that I could have used.

        After my friend pointed this out, I used Forms!!.setfocus command which did the trick.

    Viewing 0 reply threads
    Reply To: Using If…Then…Else statement for setting tab

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: