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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New record

Status
Not open for further replies.

EasyOnly

Technical User
Oct 11, 2008
55
0
0
US
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.
 
How are ya EasyOnly . . .

I can't put this together, as far as what you want or what your doing.

[purple]Put the macro completely out of your mind[/purple] ... start a new thread and tell us what you want! Don't forget to identify form names, subform names,control names, table & field names and relationships.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top