Results 1 to 12 of 12
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Making a Combo Box look like a Text Box

    I have a Combo control for CustomerName where the underlying control source is customer number, but the operator selects customer name in the dropdown... very basic stuff. On a separate tab control (page), I want to have a similar control, however, it is for display only. I can use the same control with locked set to true and the operator isn't able to change the data. This is just what I want, except that the control still appears as a dropdown (Combo box) and the operator can still pull the dropdown. However, he/she can't select anything. This is a little confusing to some new operators.

    Is there a way I can make the combo box look like a text box (locked) so the operator doesn't think he/she can change it?



    Thanks, Eddie

  2. #2
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Hi Eddie,
    I found solution for you.
    To get clear understanding of my explanation let us assume some names. Let the combobox control for CustomerName be titled as "combo1".
    So as per your question, you have another combobox on seperate page (name it "combo2") which has to read/get the value from combo1 and show it to user, but user shouldnot edit it here.
    So what you do is, go to the page where you have combo2 already designed and go to 'Property Sheet' by clicking Design View. While this property sheet is open, click on the 'combo2' so as to get its particular properties displayed. Now in the 'Data' tab in the property sheet, you can see a field named 'Control Source'. Click on the '...' at the end of this field, which opens up another window called 'Expression Builder'. You can then see empty space where you can write your expression.
    You then write:
    =[combo1].[SelText]
    then click Ok.

    Thats it. It will work.
    PS: replace combo1 and combo2 with the names of your combo boxes.

  3. #3
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    If your combo2 is the one the operator can select from, shouldn't the control source be CustNbr? Then on combo1 (the one that is read only), are you saying the control source there should be =combo2.SelText? This doesn't work. Control combo1 is blank and still has the dropdown active (although you can't select anything). If I change combo1 to a TextBox, I don't have the dropdown (which is good), but the value is #error.

    If I just copy/paste combo2 as combo1 on the other tab and lock it. I get the display of the Customer Name and the operator can't change it. However, the dropdown capability makes it appear as if he/she can.

  4. #4
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    I said combo1 is the one the operator selects from, and combo2 is the one that is read only..
    so in the combo2 expression builder, you just write
    =[combo1].[SelText]

  5. #5
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    Let me re-phrase my response...

    If your combo1 is the one the operator can select from, shouldn't the control source be CustNbr? Then on combo2 (the one that is read only), are you saying the control source there should be =combo1.SelText? This doesn't work. Control combo2 is blank and still has the dropdown active (although you can't select anything). If I change combo2 to a TextBox, I don't have the dropdown (which is good), but the value is #error.

    If I just copy/paste combo1 as combo2 on the other tab and lock it. I get the display of the Customer Name and the operator can't change it. However, the dropdown capability makes it appear as if he/she can.

  6. #6
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    I assumed that your combo1 is alrready connected to CustNbr.
    If not, then in the property sheet in the field 'Row Source' which is below the ControlSource, you can directly give all the field names like:
    "xxx";"yyy";"zzz" which should be same name like in CustNbr.
    And as for combo2, yes, it is equal to
    =[combo1].[SelText]
    and don't forget to put the [] brakcets.

  7. #7
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    Okay, we're getting closer now. If I make combo2 a text box and fill in the Control Source with =[combo1].[SelText], then if I make a selection on combo1, combo2 is populated with Customer Name just like I want it... so far, so good. However, when I first open the form, if combo1 has already been populated from a previous entry, combo2 shows up with #error.

  8. #8
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Well, I'm not sure now. But I think you can assign a default value to your combo1 and try, instead of the case where it is populated from previous entry.
    In the property sheet of combo1, in the 'Data' field you have an option for 'Default Value'. Try to assign it with any of the field and see whether the combo2 stil shows up #error

  9. #9
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Hi
    did it work? Let us know...

  10. #10
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    No, that did not work. The Default Value is used only before any data populates the control. Once the Control Source is non-null, it has not meaning. Still not there.

  11. #11
    Secue is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    33
    EddieN1:

    If I understand, you have a form that you are using to enter data, I think on your table design you set one field to selct a vuale froma a list, then when you ude this field on your table to enter the data drop menú is displayed and user cna select the apporpiated value.

    then you have a second fomr, where you are displaying the information, you set the property Locked to YES, and user can not change the value, to avoid to have user the option to drop the menú you must change the combo box to a text box, which is simply by selecteing the combo box, click with right button, from the menú that appears select the option change to, and then select text box.

  12. #12
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Alternatively, you can set the Enabled to No in the properties window. Is that what you want?

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

Similar Threads

  1. Replies: 2
    Last Post: 08-16-2012, 10:02 PM
  2. Replies: 4
    Last Post: 08-16-2011, 05:54 PM
  3. Replies: 5
    Last Post: 08-05-2011, 12:33 PM
  4. Making a toggle button hide a text box.
    By RemonKoybito in forum Forms
    Replies: 3
    Last Post: 05-20-2011, 11:34 AM
  5. Making Goto combo box
    By dragmn2 in forum Forms
    Replies: 0
    Last Post: 07-03-2010, 11:53 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