Need GoToNew on SubForm

B

Bonnie

Hi folks! Using A02 on XP. Have a form for contract
records with a subform to record participant enrollments
in each contract. I need the sub form to 'gotonew' when
the main form moves from record to record.

I put the following on my sub form's OnOpen Event and it
works when I first open the form (to contract record 1)
but when I find the contract I need, the sub form only
shows existing records.

DoCmd.RunCommand acCmdRecordsGoToNew

Don't want to make the form AddNewOnly as we do need to
edit some existing records. But most of the time, we are
adding records.

I figure I need to put the GoToNew on the OnCurrent Event
of my main form but don't know what wordage to use. Can
someone put me back on track? I would really appreciate it.

Thanks in advance for any and all help and advice!!!
 
D

DebbieG

Try

Forms!YourMainForm!YourSubForm.Form.NewRecord

HTH,
Debbie


Hi folks! Using A02 on XP. Have a form for contract
records with a subform to record participant enrollments
in each contract. I need the sub form to 'gotonew' when
the main form moves from record to record.

I put the following on my sub form's OnOpen Event and it
works when I first open the form (to contract record 1)
but when I find the contract I need, the sub form only
shows existing records.

DoCmd.RunCommand acCmdRecordsGoToNew

Don't want to make the form AddNewOnly as we do need to
edit some existing records. But most of the time, we are
adding records.

I figure I need to put the GoToNew on the OnCurrent Event
of my main form but don't know what wordage to use. Can
someone put me back on track? I would really appreciate it.

Thanks in advance for any and all help and advice!!!
 
B

Bonnie

Hi Debbie. Thanks for the reply. I copied your data and
put the following in my main form OnCurrent event:

Forms!EnrollmentFormMain!EnrollmentFormSub.Form.newrecord

As you can see, the newrecord lost it's caps and I'm
getting Error #438 - Object doesn't support this property
or method.

Am I putting it in the wrong place or missing something?

Thanks for you help!!!
 
D

DebbieG

Bonnie,

Sorry, I gave you the wrong thing. Try this in OnCurrent:

Forms!EnrollmentFormMain!EnrollmentFormSub.Form.AllowAdditions = True

Debbie


Hi Debbie. Thanks for the reply. I copied your data and
put the following in my main form OnCurrent event:

Forms!EnrollmentFormMain!EnrollmentFormSub.Form.newrecord

As you can see, the newrecord lost it's caps and I'm
getting Error #438 - Object doesn't support this property
or method.

Am I putting it in the wrong place or missing something?

Thanks for you help!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top