Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389


    Quote Originally Posted by Minty View Post
    The problem is that you are setting the offer date in code, which instantly dirties the record.
    There are a host of other things that aren't correct but that is causing most of your issues. Just put in Date() in the default value of the control, that doesn't dirty the record when you go to a new one.

    Also, please please please give your controls meaningful names. txt1, txt 2 txt133 mean absolutely nothing, and make debugging a nightmare.
    I have removed the coding of offer date but still the problem is same and please tell where to set the "date()"

  2. #17
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    In the default value of the Offer Date control.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #18
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Minty View Post
    In the default value of the Offer Date control.
    Ok but my problem is still

  4. #19
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Minty View Post
    In the default value of the Offer Date control.
    As soon as you fill fields other than txt2 and close the form and select no, an error box appears.

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You have not learnt anything have you?
    Why not say what the error message is?

    Trying to help you is like trying to get blood from a stone.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #21
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Welshgasman View Post
    You have not learnt anything have you?
    Why not say what the error message is?

    Trying to help you is like trying to get blood from a stone.
    Sir, I have attached the error message several times. please check
    Attached Thumbnails Attached Thumbnails msgUntitled.png  

  7. #22
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by deepaksharma View Post
    same message is coming even after deleting the record set.
    check also...

  8. #23
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by deepaksharma View Post
    Sir, I have attached the error message several times. please check
    You never said it was the same error message? Even that would have helped.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #24
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Welshgasman View Post
    You never said it was the same error message? Even that would have helped.
    maybe there is a lack of understanding between us... sorry for that.

  10. #25
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by deepaksharma View Post
    maybe there is a lack of understanding between us... sorry for that.
    Yes, likely on my side , so I will step away.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #26
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Welshgasman View Post
    Yes, likely on my side , so I will step away.
    no no no please..

  12. #27
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by deepaksharma View Post
    Sir, I have attached the error message several times. please check
    Can anyone tell me why this error is coming?

  13. #28
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Because something in your code is making alterations to the record, that are dirtying the record, that you are then trying to save after making other changes.
    In the example you posted setting the date field in code was dirtying the record, then you are trying to undo the changes after making other changes to the forms data, but you validation is stopping it.

    There is something else going on though as the cancel method in the forms before event is undoing all the data entered, and it shouldn't do that, it should simply prevent you from saving the data.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  14. #29
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Minty View Post
    Because something in your code is making alterations to the record, that are dirtying the record, that you are then trying to save after making other changes.
    In the example you posted setting the date field in code was dirtying the record, then you are trying to undo the changes after making other changes to the forms data, but you validation is stopping it.

    There is something else going on though as the cancel method in the forms before event is undoing all the data entered, and it shouldn't do that, it should simply prevent you from saving the data.
    But I did not find anything like this in it, so I created another sample program. You can see in it that if the program is closed after entering data in other fields except the BB field, then the same error occurs.
    Attached Files Attached Files

  15. #30
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Deepak

    It works for me.

    I corrected the relationships as you had not put an Autonumber in Table2
    I also modified the Autonumber fields from ID to Table1ID and Table2ID
    Attached Files Attached Files
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. control undo
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 08-18-2021, 12:43 AM
  2. Replies: 4
    Last Post: 11-24-2020, 03:41 PM
  3. to Undo, or not to Undo...
    By Davince in forum Forms
    Replies: 2
    Last Post: 02-19-2015, 07:23 PM
  4. Replies: 2
    Last Post: 10-31-2012, 11:52 AM
  5. Undo problem
    By Waubain in forum Programming
    Replies: 4
    Last Post: 10-27-2011, 12:36 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