Use button to open new form

mderby

Registered User.
Local time
Tomorrow, 07:55
Joined
Apr 14, 2003
Messages
41
Hi all expertise,

Let list the detail of my program.
I created a form(Maint) based on a table Project Master only. In ADD form I used a combo box to link to the Project ID field in Project Master. This Project ID is a AutoNumber Key field.

The user can use the Maint form to key in new project or change existing project info.

There is another table Project Detail which is linked to Project Master in the Table Relationship by Project ID field.

In Maint form, there is no issue changing the data for Project Master.

But the problem is with the insert new project in Maint form. I have created a button named Add button when click will save the record and open the Project Detail's form with the newly created Project ID. Some how I could link the newly created Project ID in Maint form to another form.

Hopefully there are some experience guys out there who can help me.

Thanks

Regards
Derby.
 
Why not create a form based on the project master, and add a subform for maint? Access will deal with the link between the two tables. When you add a new project in Master, the subform will be ready to accept the Maint records.
 
I suppose using subform will clear it but I just want to know how to retrieve back the Project ID (autonumber) value after an update to the form. I want to use it to link to another form.

Correction to my original post.
it should be "Some how I could not link the newly created Project ID in Maint form to another form."

mderby
 
I guess you can do what you want, but I'm not sure how. Perhaps someone else can help.

You can reference the new project ID using the expression Forms![Mainform]![Control]

But, as the ID is a new one, there won't be any records in the Details table to match.

Perhaps I'm just being thick today, and there is an obvious answer!
 
Open the form in Add mode, set the keyID to your newly added one having saved the record
Forms!MyForm!MyIDField=Me.MyID
 
I am being thick today. I have plenty of proof
 
Hi guys,

I had solve this issue by using parent/child forms

Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom