Forcing a new rec on a subform from a diff form

DrSnuggles

Well the hell is Hudson??
Local time
Today, 06:21
Joined
Sep 14, 2004
Messages
117
Ciao!

(Access 97 Prob)
Backgorund:
I have a main form "Form A" with a subform "Form A1".
The subform allows users to add Candidates for a certain test.
I have allowed a button on "Form A" that will show a new form "Form Z" that lits all Candidates already in the db.
The idea is that when a user chooses a Candidate from "Form Z" (and clicks a button) it should populate the subform "Form A1". - All this I can do.

Problem
I need to force a new record on the subform "Form A1" just before I pass the Candidates details from "Form Z".
Otherwise if the cursor is left on any rec in subform "Form A1" it is overwritten by the details from "Form Z".

Any ideas are absolutely welcome!!
 
If you do a setfocus for to subform then

DoCmd.GoToRecord , , acNewRec

Will this work?

kh
 
doesn't work

Thx for the reply.

Unfortunately although setting focus to the other subform, it creates a new record in the other form "Form Z".

I will try recordsetclones now.
 
Forms!YourMain!YouSub.SetFocus
SomeControlOnYourSubFrm.SetFocus
DoCmd.GoTo Record etc.
 
Anyway - This will allow a user to create a new record from two different entry points. Now you have to manage validation from two different viewpoints - Hard to manage and sometimes can lead to spagetti code.

I would move the form z button to the subform and force the user to start the new record in the standard continuous forms fashion, then click on the auto fill stuff.

Or use combo box...

kh
 
Thx

Good point Batman!
I'll stick the button on the subform.
On click - move to new rec.
Open Z form and make modal.

Excellent!

It's just too easy! :P
Thx KenHigg
 

Users who are viewing this thread

Back
Top Bottom