I have removed the coding of offer date but still the problem is same and please tell where to set the "date()"
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.
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 ↓↓
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
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
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
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 ↓↓
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.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.
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
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description