Results 1 to 8 of 8
  1. #1
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102

    Monitoring of data entry in a field

    Hi all, and thanks to all those that have helped thus far, I have another issue. I have this on the before update in a field to monitor changes to prompt the user that they have made a change and to make sure the change is correct.



    Const MESSAGETEXT = "Do you wish to make changes to the Status?"

    Beep
    If MsgBox(MESSAGETEXT, vbYesNo + vbQuestion) = vbNo Then
    Cancel = True
    Me.Undo
    End If

    I would like this to only appear if the 'status' changes to certain words. ie. 'Disposed', 'sold' etc.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    do you mean a field or a control?

    if a control then modify your code to something like

    Code:
    Const MESSAGETEXT = "Do you wish to make changes to the Status?"
    
    if mystatuscontrol="Disposed" or mystatuscontrol="sold" then
         Beep
         If MsgBox(MESSAGETEXT, vbYesNo + vbQuestion) = vbNo Then
             Cancel = True
             Me.Undo
         End If
    End if

  3. #3
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi thanks for your reply Ajax, it is actually a combobox.
    I will try your method and let you know.

  4. #4
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Didn't work, there is obviously some more code to add to monitor the status change!

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    well, 'didn't work' does not provide any clue as to why not - did you get an error message? returned wrong result? Perhaps your combo is bound to a hidden id column? The less information you provide, the vaguer the responses you will get

  6. #6
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    I'm sorry, there were no error messages, when the combo data was changed it didn't come up with anything just changed the combo data. The combo is fed via a status table which place the status id into the main table. Does that make more sense.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    if your combo is bound to the statusid, then that sounds likely

    so change to

    Code:
    ...
    ...
    if mystatuscontrol=1 or mystatuscontrol=2 then
    ....
    ....
    where 1 and 2 are the id's for disposed and sold

  8. #8
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi Ajax, I should have thought of that, thanks again for your help.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-25-2015, 04:48 PM
  2. Replies: 5
    Last Post: 07-24-2014, 09:32 AM
  3. Limit data entry based on another field
    By chemengr in forum Forms
    Replies: 5
    Last Post: 01-02-2014, 01:21 PM
  4. Replies: 3
    Last Post: 12-31-2013, 02:53 PM
  5. Automatic Field DAta Entry
    By Lupson2011 in forum Access
    Replies: 4
    Last Post: 09-01-2011, 09:15 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