Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Unanswered: TabControl.Value = 0

    Hi,

    I have a tab control that I use to display various information downloaded from a server. When a user selects a tab, the '.Value' property is used to establish which page they are viewing and gets the appropriate data.

    This has stopped working - i.e. the value returned is now always 0. I can get it to work by cutting code, compiling (with errors) and the pasting the code back in but when I restart the database the .Value property stops functioning again.

    Has anyone else had this problem? Is there a workaround?

    Thanks

  2. #2
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    could you put code in the tab control (per page) and manually set the value from there? something like TabControl.Value = 1

    I honestly don't know if this is possible, but it's hopefully something that may help.

  3. #3
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    could you put code in the tab control (per page) and manually set the value from there? something like TabControl.Value = 1

    I honestly don't know if this is possible, but it's hopefully something that may help.

    (Sorry for the double post)

  4. #4
    Join Date
    Oct 2004
    Posts
    11
    Thanks for the quick reply.

    OK, on further investigation it looks like the tab control isn't directly to blame, because the combo box controls are not accessible either :

    Form_frm_Main.cb_Market.Value = Null
    Form_frm_Main.cb_Currency.Value = Null
    (both these combo boxes contain values)

    Form_frm_Main.pg_Tabs.Value = 0
    (page 2 is currently selected)

    In the control's change event:-

    Private Sub pg_Tabs_Change()
    Debug.Print Me.Tabs.Value
    End Sub

    The value is correctly returned as 2. Looks like access is breaking it's references to some of the controls in the form. Has anyone come across this?

  5. #5
    Join Date
    Oct 2004
    Posts
    11
    Further (further!) investigation has let me to find the culprit, which as a totally side, side, side effect -

    The background colour of the header (which I change depending on whether the front end is connected to my test or production server) seems to have the effect of disconnecting the form from the code a bit.

    Form_frm_Main.FormHeader.BackColor = ...

    I've commented out this line of code and everything appears to be working again. (I found it because the combo boxes are in the header, and I only added the colour changing code yesterday).

    Thanks for having a look at this cruickshanks

  6. #6
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    No problem. I have an idea that might work (unless i've read your previous posts wrong, im still half asleep!)

    For each control on the independant tabs, you could setup any reference to them from them if you know what i mean. That way whenever you change the tab, regardless of what happens elsewhere, the references should be created and held. You could double up the coding for when the tabs change on the multipage element too. This will make sure that the references are always maintained.

Posting Permissions

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