Results 1 to 6 of 6
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Fill Textboxes


    Code:
    Private Sub Command2_Click()
    Dim sql As String
    
    
    sql = "SELECT [Titile] " _
            & "FROM Alumni_List " _
            & "WHERE [Given_Names] LIKE '*" & Me.Text0 & "*' "
    Me.Combo41.RowSource = sql
    End Sub
    Hi Please see above code

    i am trying to fill a combobox based on values that is entered into a textbox, for example if enter "Mike" in Text0 then combobox should show his title upon a button click.

    Hope you could help me on this.

  2. #2
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Hmm, doesn't look like you are requerying the Combo Box, I would add that line. I also see Titile instead of Title, is that what you have?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    That is an odd requirement. Why would you want a combobox with a single item in list?

    Why don't you select Mike from combobox that has Title as column?

    Are you really spelling Title as Titile in database?
    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.

  4. #4
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hey

    I'm sorry it should be Title, typing mistake,

    Is there is anyway that i could return a value to textbox from a table based on a value entered into another textbox upon button click.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    A DLookup() domain aggregate function can do that. Usually better method is to use multi-column combobox to pull associated data to form.
    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.

  6. #6
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    You can but why? Is this just for display? Or are you wanting Cascading Combo Boxes. Just seems like you are trying to store a value that may not need to be stored.

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

Similar Threads

  1. Replies: 19
    Last Post: 01-30-2019, 08:21 PM
  2. too much space between textboxes
    By markjkubicki in forum Reports
    Replies: 5
    Last Post: 08-17-2017, 10:37 AM
  3. Dynamic textboxes
    By braddy in forum Database Design
    Replies: 2
    Last Post: 11-15-2013, 02:16 AM
  4. Formating Textboxes
    By desibabu90 in forum Forms
    Replies: 6
    Last Post: 08-02-2011, 07:48 AM
  5. Replies: 0
    Last Post: 06-29-2011, 01:04 PM

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