Results 1 to 3 of 3
  1. #1
    ptslv is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    10

    Exclamation How to Populate text box with slider value in access 2007 form

    I have added a slider control (Microsoft Slider Control, version 6.0) to my form and added a text box to display the value of the slider. The slider will be used to select ratings for questions.



    I am unable to get the textbox to show the value of the slider on the form. If I move the slider and exit the form, the correct value shows in the table. How do I get the value to show in the text box before closing the form? My code is below.


    [code]
    Option Compare Database

    Private Sub Form_Open(Cancel As Integer)

    If Me.txtRating.Value <> Null Then
    Me.Slider1.Value = Me.txtRating.Value
    Else
    Me.Slider1.Value = 0
    End If

    End Sub


    Private Sub Slider1_Exit(Cancel As Integer)
    Me.txtRating.Value = Me.Slider1.Value
    End Sub


    Private Sub Slider1_Updated(Code As Integer)
    Me.txtRating = Me.Slider1

    End Sub


    Private Sub txtRating_AfterUpdate()
    Me.txtRating.Value = Me.Slider1.Value

    End Sub


    [code].

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    So the slider is not a bound control? The code saves value to the field? Is the textbox bound to the field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ptslv is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    10
    The text box is bound to a field in the database. I found that when I click off the slider and into the text box, the value now updates in the text box.

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

Similar Threads

  1. Auto Populate a text box in a continuous form
    By KevinCollins in forum Access
    Replies: 6
    Last Post: 10-28-2013, 08:04 AM
  2. Slider problem with Access 2010
    By justphilip2003 in forum Forms
    Replies: 3
    Last Post: 06-05-2013, 06:44 AM
  3. Replies: 12
    Last Post: 06-25-2012, 01:42 PM
  4. Replies: 1
    Last Post: 03-01-2012, 10:52 AM
  5. Replies: 9
    Last Post: 01-19-2012, 03:03 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