Hi Deepak
Well your thought process is all wrong.
Step 1 - You have a Form for creating new Grey Orders
In this process you are using the following OnLoad Event
Code:
If DMax("Offer_ID", "GREY_OFFER") >= 1 Then Me.TXT0 = DMax("Offer_ID", "GREY_OFFER") + 1
This is absolutely the WRONG way to do this.
You are using the
Primary Key "Offer_ID" to generate a Unique Number when Access will already do this Automatically
when you add data to the Form.
You should have a field in the Grey_Offer table named
OrderNumber and then use the
DMax Funcrion to generate a Unique OrderNumber
Step 2 - At some time in the future you need to
edit/look at a specific
OrderNumber by using your OnClick Event to open the "
Offer_Registry" Form.
You do not need any code whatsoever in the On Load of this Form as the Record has already been created with a Unique "
OrderNumber"