Results 1 to 8 of 8
  1. #1
    Frannilea is offline Novice
    Windows 10 Access 2007
    Join Date
    Jul 2020
    Posts
    27

    Combobox Field Save Prevention

    Hi. I'm teach English as a second language and I'm writing a database to give my young students more listening practice. They have to listen to the audio, choose the translation (from the Korean list box, then choose the worlds of the sentence for each of the combo boxes. Then they press the check button to see if they're correct(if they are incorrect, corrections appear above the incorrect box), then the Next button, which saves the data, allocates point etc and repopulates the form with the next sentence.

    I have a table of words only, which populates the list boxes, and a table containing the sentences that checks that the words are correct. The words are always in lower case (except for names), but sometimes, I need a word to be in upper case in the middle of a sentence, that wouldn't normally be. The first word is easy - I simply added ">". But the other irregular words are more difficult. For example, "mom" can be lower case or upper case, eg, "My mom is great!" "Where's Mom?" So I need the system to proper case the word sometimes. If I need a word to be Proper case than the app compares the word in the combobox against that in the actual sentence and if they differ, then changes it to the sentence table version.

    I've nearly finished my app. I swear this was working well when I tested it, but now it's not for some reason.



    I hope it's a simple solution. Please find pictures of my app and what I think are the relevant information required below.

    And please note that I am NOT a programer. I'm just a teacher, and this is only my second app - the previous one I wrote about 10 years ago, so this is learning curve number two for me. Please treat me as a complete NOOB!

    Thanks in advance. :-)

    Click image for larger version. 

Name:	Combo Field Save PreventionErrorMsg.png 
Views:	16 
Size:	66.3 KB 
ID:	51583
    Click image for larger version. 

Name:	Combo Field Save PreventionProperties.png 
Views:	16 
Size:	11.5 KB 
ID:	51584
    Click image for larger version. 

Name:	Combo Field Save PreventionCode.png 
Views:	16 
Size:	44.5 KB 
ID:	51585
    Click image for larger version. 

Name:	Combo Field Save PreventionTable.jpg 
Views:	16 
Size:	183.8 KB 
ID:	51586

  2. #2
    Join Date
    Apr 2017
    Posts
    1,679
    Why not simply
    Code:
    ...
    If Lower(Me.cmbWord2) = Lower(rst!Word2) Then
         Me.Chk2 = True
         ...
    End If

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Basically, user has updated a control that is bound to a table or query field, then has done something to cause the update event to run (if this is a combo, likely user has made a selection from the combo list). So the value that it once had is different from the value it now has, but the new value has not been committed/changed. You cannot edit the value before this happens. You could do it in the After Update event though - unless an update results in a list item value that violates what the table field allows.

    EDIT - Actually I don't think you can change the case of a list item if the list comes from a table or query. You'd have to have the different case options be list items. You might be able to edit a list item if the combo is based on a value list and not a table/query field. However this will permanently alter the value until it is altered again.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Frannilea is offline Novice
    Windows 10 Access 2007
    Join Date
    Jul 2020
    Posts
    27
    @ArviLaanemets


    I need to make the word Proper Case if the field and the table are different. The Chk2 is a checkbox that tells me that something is entered in that field for an entirely different purpose. It has nothing to do with Proper Case issue.

    I'm not sure what you mean. How do I make the field proper case if the field and the table are different? Or alternatively, make the chosen item of the Combo box = table field. Either would do.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You should specify who you are addressing.
    I edited my post, probably after you read it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Frannilea is offline Novice
    Windows 10 Access 2007
    Join Date
    Jul 2020
    Posts
    27
    @Micron

    Yes! That was it! Thank you sooooo much! I was tearing my hair out!! I have 14 combo boxes for 14 word sentences, and that one Combo box I must have just misclicked, choosing the "BeforeUpdate" function instead of the after one! Yay!! I'm an idiot!! :-)))

  7. #7
    Frannilea is offline Novice
    Windows 10 Access 2007
    Join Date
    Jul 2020
    Posts
    27
    Quote Originally Posted by Micron View Post
    You should specify who you are addressing.
    I edited my post, probably after you read it.

    Hehe, I edited it to add the name immediately. I was too slow or you were too quick. :-)) I hadn't realised that there was a second reply under that one until I posted it. Your initial post fixed my problem and your edit added to my knowledge. :-)

    Thanks again! I added to your reputation.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Glad I could help & thanks for the recognition.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Improving Double entry prevention
    By eseng in forum Access
    Replies: 2
    Last Post: 05-09-2022, 09:39 AM
  2. Double Booking Prevention?
    By Maths9876 in forum Access
    Replies: 2
    Last Post: 12-27-2016, 08:41 PM
  3. save selected value from combobox
    By osnatk in forum Access
    Replies: 3
    Last Post: 08-05-2016, 09:52 AM
  4. Replies: 1
    Last Post: 02-01-2015, 12:16 AM
  5. Duplicate Entry Prevention
    By bklewis in forum Access
    Replies: 12
    Last Post: 02-26-2012, 08:02 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