View Single Post
  #5  
Old February 4th, 2010, 01:49 PM posted to microsoft.public.access.forms
Justin
external usenet poster
 
Posts: 27
Default Setting subform to add mode while main form is in edit mode

On Feb 4, 7:45*am, Justin wrote:
On Feb 3, 6:36*pm, John W. Vinson
wrote:



On Wed, 3 Feb 2010 12:07:30 -0800 (PST), Justin wrote:
Is it possible to have the subform on a main form open in add mode
while the main form is in edit mode?
I have a main form that shows the first and last name of my drivers
while the subform is for entering a date and number of hours on duty
for that date. The subform is beginning to have a large number of
entries and I have to scroll down to the last entry to begin entering
data.


Thanks for your help


Justin


Sure. Jeanette's suggestion of "Data Entry" will work.


However, it has the disadvantage that if Data Entry is set to Yes, then that's
ALL you can do - add new records - and you won't see any existing ones.


As an alternative, you can use the Load event of the subform to jump to the
new record:


Private Sub Form_Load()
DoCmd.GoToRecord, , acNewRecord
End Sub
--


* * * * * * *John W. Vinson [MVP]


Your method is what I was shooting for John. I had looked at
Jeanette's method before, but wasn't sure that it was what I really
wanted. Thanks to the both of you for helping to educate another
novice.

Justin


Guess I should have tried it before I responded. I put your code in
the Load event of the subform and it hangs up. Should this code go
into another event in addition to the load event? I copied the code
and pasted it into the event and it didn't give an error until I tried
to open the main form. The run-time error 2105 comes up saying that
"you can't go to the specified record".
Thanks again for you help.

Justin