Results 1 to 15 of 15
  1. #1
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97

    lock the editing of combobox text

    Hello
    I want my users to be able to always change the combobox but only with the data from the combobox...

    let's say I have

    doors
    windows
    floors


    ceiling

    those are the only 4 values i want

    but in access if I select let's say doors and I click on the combox box the users can change the text to

    doorsasdafege or just plain nothing

    In validation rule I puted is not null
    and I limited to list but limit to list only works on new record... if I want to edit an already exisiting records it doesn't raise an error

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Grooz13 View Post
    Hello
    I want my users to be able to always change the combobox but only with the data from the combobox...

    let's say I have

    doors
    windows
    floors
    ceiling

    those are the only 4 values i want

    but in access if I select let's say doors and I click on the combox box the users can change the text to

    doorsasdafege or just plain nothing

    In validation rule I puted is not null
    and I limited to list but limit to list only works on new record... if I want to edit an already exisiting records it doesn't raise an error
    Set the combo box's property to "Limit to List". Any subsequent value, even existing record will be limited

  3. #3
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    no it does not i tried it if i write in the an already filled combobox it doesn't raise any error

  4. #4
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Grooz13 View Post
    no it does not i tried it if i write in the an already filled combobox it doesn't raise any error
    I just ran this in Access 2010. If the existing value in the table is not already complying with the value in the list, then the existing value stands. However, if you try to change the value to another value other then values in the list, then the error pops up. Also, ensure the Allow Value List Edit is set to no. This will prevent your users from adding new values to the row source

  5. #5
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    welll i'm in access 2007 and it doesn't work

  6. #6
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    but can't I just remove the possibility to enter text and only use the arrow ?

  7. #7
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Grooz13 View Post
    but can't I just remove the possibility to enter text and only use the arrow ?
    No, when you choose a value from the list, you are accually entering text, but from the list, therefore, the property for the field cannot be locked. Also, I just checked the limit to list setting in my Access 2007 version, and it worked just like in 2010. No other value can be entered into the field even if the record already exist. You might post your db here so we can take a look to see what is happening

  8. #8
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    ok I will post it but it's in french
    when it loads

    click on COMMANDE
    and the combobox are the combobox in the subform

    if i write anything in the combobox where it's written portes and then click on autres2 no error is raised

    oops forgot to put it

  9. #9
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Toyman View Post
    No, when you choose a value from the list, you are accually entering text, but from the list, therefore, the property for the field cannot be locked. Also, I just checked the limit to list setting in my Access 2007 version, and it worked just like in 2010. No other value can be entered into the field even if the record already exist. You might post your db here so we can take a look to see what is happening
    Wait, are you saying that your user can change the value to "no value" and you tried to use "No null" value for the field?

    If this is what you meant, then what you can do to prevent a blank value is put the following code in the after update event of the field:

    Dim sValue as string
    sValue = Nz(YourFieldName,"")
    if sValue = "" then
    Msgbox "You must enter something",vbInformation
    Exit Sub
    End If

  10. #10
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    no my is not null is just a different validation

  11. #11
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    i putted my bd in my post above yours

  12. #12
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Grooz13 View Post
    no my is not null is just a different validation
    Ok, your combo box was not set to limit to list = yes and it allow editing of the list. I changed it. Hope this works

  13. #13
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    if I change anything written where PORTES is written there is nothing happening

  14. #14
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by Grooz13 View Post
    if I change anything written where PORTES is written there is nothing happening
    Ok, I changed the Inherit Value List = No and Show Only Row Source Value =yes. I further change the property setting for the field in the table to a text box instead of a combo box. This seems to fix the problem.

  15. #15
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    You sir are my savior thx for everything and all the time you put into my problem !

    Solved !

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

Similar Threads

  1. Replies: 1
    Last Post: 07-18-2011, 03:08 AM
  2. Lock Record for Editing on a Linked table
    By khalid in forum Programming
    Replies: 3
    Last Post: 06-14-2011, 08:37 AM
  3. Replies: 3
    Last Post: 05-13-2011, 08:48 AM
  4. Replies: 0
    Last Post: 03-26-2007, 12:24 AM
  5. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 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