Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform action only after new record created

Status
Not open for further replies.

NRK

Technical User
Feb 13, 2002
116
US
I have a form that has a main and a subform. Users are able to look up records (with fields contained in the sub) from a lookup combo box in the main form (only field present).

Once they find the records they want (this will usually be a set as the lookup field on the main is called Category), they can add a new record or replicate nearly all data of the current record. If they replicate the data, I want the ID field and other crucial fields to be uneditable while allowing the rest to be able to edit. If they create a new record, I want all fields to be editable.

So, is there a way to perform certain actions after a certain action (i.e. Add/Replicate)? If so, can someone give me a pointer on how to do it?

Thank you, in advance.

 
I would declare a form level variable(boolean). Set the value of the variable based on whether or not you are replicating. Then use the BeforeInsert event of the form to lock down your controls. Let me know if you need more details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top