Open Subform to Blank

A

AmytDev

I have a subform linked to a main form by a field called problem. When a
value is entered into a field called part in the main form, it populates the
problem field. The subform then displays the first record corresponding to
that Problem field.

Anyone know how I could open a subform to a new record rather than the first
record?
 
O

Ofer

On the after update event of part field, run the code

Me.SubFormName.Requery
Me.SubFormName.SetFocus
DoCmd.GoToRecord , , acNewRec
 
D

Dirk Goldgar

Ofer said:
On the after update event of part field, run the code

Me.SubFormName.Requery
Me.SubFormName.SetFocus
DoCmd.GoToRecord , , acNewRec

I'm not convinced you need the requery. If the subform is linked by the
[part] field, it will automatically "requery" to show the related
records.
 
O

Ofer

I just wanted to make sure that the form is refreshed before I continue to
the new record.


Dirk Goldgar said:
Ofer said:
On the after update event of part field, run the code

Me.SubFormName.Requery
Me.SubFormName.SetFocus
DoCmd.GoToRecord , , acNewRec

I'm not convinced you need the requery. If the subform is linked by the
[part] field, it will automatically "requery" to show the related
records.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Top