Results 1 to 6 of 6
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    combobox re-sizing

    I have a combobox with 2 columns, (the 2nd being bound)


    when the user opens the form, I only want the combobox's drop down arrow visible (not the data)
    when thee arrow is clicked, the full width (the data columns) should be visible, and the user can choose in a normal way
    once that choice is made, the bound information will be visible in an adjacent textbox, where it can then be edited(this is essential)

    when the combobox is of a normal configuration (one width, columns visible, never changing), all works fine (the user can make choices, the text box populates, it can be edited <etc.>)

    HOWEVER
    when I add code to change the combobox's width, the combobox width adjusts as coded; BUT, the user's choice (in the combobox) "doesn't stick" (?) (i.e. they click, but nothing happens, no data is assigned...)

    Code:
    Private Sub cboInstallationNote_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
                     Me.cboInstallationNote.Width = 7200
    End Sub
    Private Sub cboInstallationNote_AfterUpdate()
                     Me.cboInstallationNote.Width = 300
    End Sub
    confused I am; and would appreciate ant thoughts, with thanks in advance.
    mark

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What do you have there that you think would "assign" the value? Does this help?

    http://www.baldyweb.com/Autofill.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    If the combo is bound to a table and the form loads a record/records from that table, you cannot have the combo blank if there is data for it in those records.
    Your code contains syntax for controlling the combo width, so I'm thinking that is your major problem, but that's not clear in your post. I don't know what this means
    BUT, the user's choice (in the combobox) "doesn't stick" (?) (i.e. they click, but nothing happens, no data is assigned...)
    I think what you're wanting to do is control the list width, not the control width. List width is a property on the sheet. Why not just set it to be equal or slightly greater than the sum of your column widths?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This seemed to say otherwise:

    when the user opens the form, I only want the combobox's drop down arrow visible (not the data)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Why not just allow the combobox to be editable? Set LimitToList to No. User can type whatever they want. The combobox list can assist with input but user is allowed to modify the entry. I do that.
    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
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    some insight into why I was trying this approach...

    The size of 2 fields in the drown down are quite disparate: one is 5 to 8 words , the other (the bound one) can be a full 255 characters (usually not... but potentially so).
    Once the record is added, there is NEVER a reason to know / see / return to the other (short) field...

    But there was another conflict (that I ALWAYS forget happens) and that forces me into a different direction: when I changed the format of the (new) record (being added), the format of all so the records already having been added (in a continuous form) also changed. This was not good.

    So in the end: 3 plus 3 = 6, but so is the square root of 36; and so, I'm taking a different route.

    many thanks for the input,
    mark.

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

Similar Threads

  1. Popup sizing
    By Thompyt in forum Programming
    Replies: 2
    Last Post: 09-21-2015, 02:20 PM
  2. sizing
    By slimjen in forum Forms
    Replies: 7
    Last Post: 06-07-2014, 04:48 PM
  3. Sizing of a report
    By ETCallHome in forum Reports
    Replies: 7
    Last Post: 06-25-2011, 10:51 PM
  4. Sizing and positioning
    By 161 in forum Database Design
    Replies: 1
    Last Post: 04-09-2011, 10:52 AM
  5. Pictures sizing
    By newtoAccess in forum Access
    Replies: 0
    Last Post: 11-22-2009, 10:10 AM

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