Results 1 to 8 of 8
  1. #1
    hung_ko is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    21

    functio call in "on current" event doesn't work

    Hi, i have a split form with a tab and listbox and i set the on current event on the form as the following, so the tab will be hidden and the rowSource will be updated whenever user selects a new record.



    however, nothing worked, but MsgBox.

    anyone?
    thank you for your help.

    Private Sub Form_Current()
    linkTabs.Visible = False

    MsgBox "JJK"

    Me.cbo_vpl.RowSource = "SELECT p.platform_id_cd, p.platform_title_tx " + _
    "FROM variant_platform_link vpl, radio_variant rv, platform p " + _
    "where vpl.[Radio Variant] = rv.radio_variant_id_cd " + _
    "and vpl.[Platform] = p.platform_id_cd " + _
    "and rv.radio_variant_id_cd = " + Str(radio_variant_id_cd)

    MsgBox "JJK2"
    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would put the SQL string in the SQL View of a query and see what happens. Then look at the Datasheet view of that query.

  3. #3
    hung_ko is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    21
    yes, the sql statement works.
    and it totally works if i update the rowSource in a onClick function(with a button on the form), but which will require one extra click by user.

    thanks,

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You are just changing the RowSource of a ComboBox, right?

  5. #5
    hung_ko is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    21
    a listbox to be exact.

    thanks,

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A ListBox with a name like cbo..., interesting. Try adding in a:
    Me.cbo_vpl.Requery to see what happens. It should not be necessary but we're stabbing in the dark here. You might also try *importing* your db into a fresh new db and see if the problem follows: http://www.btabdevelopment.com/ts/impnew

  7. #7
    hung_ko is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    21
    somehow Requery works!
    still not sure why .Visible = false/true in On Current event doesn't work.
    but updating my listbox with Requery is what i need now.

    Thank you so much for you help
    sorry about the bad naming convention btw, ha

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I've not used split forms so I don't know.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 06-14-2010, 08:39 PM
  2. Replies: 3
    Last Post: 04-10-2010, 10:22 AM
  3. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  4. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums