OpenForm: ProjectSub_tbl, Form, , ="[ProjectID]=" & Nz([ProjectID],0), , Dialog
SetTempVar: ProjectID, [ProjectID]
SetTempVar: ProjectID, Nz(DMax("[ProjectID]",[Form].[RecordSource]),0)
Requery
SearchForRecord: , , First, ="[ProjectID]=" & [TempVars]![ProjectID]
RemoveTempVar: ProjectID
I copied thr above macro from one of the microsoft access 2007 templates. I want to be able when I click on projectsubId and there is an exisiting record, it open it. If not, it create a new record and copy the ProjectID from the parent table and place it in the projectsiD_tbl in projectID field.
If codes can do this, I think this will be easier.
I am not sure what do I need to modify in the above to achive that.
Any help will be appriciated.
SetTempVar: ProjectID, [ProjectID]
SetTempVar: ProjectID, Nz(DMax("[ProjectID]",[Form].[RecordSource]),0)
Requery
SearchForRecord: , , First, ="[ProjectID]=" & [TempVars]![ProjectID]
RemoveTempVar: ProjectID
I copied thr above macro from one of the microsoft access 2007 templates. I want to be able when I click on projectsubId and there is an exisiting record, it open it. If not, it create a new record and copy the ProjectID from the parent table and place it in the projectsiD_tbl in projectID field.
If codes can do this, I think this will be easier.
I am not sure what do I need to modify in the above to achive that.
Any help will be appriciated.