Opening Subform

jax

Registered User.
Local time
Today, 08:44
Joined
Mar 4, 2002
Messages
61
I want to open a subform with all fields blank ready for new information to be entered. I have entered the code below in the event procedure of the command button which opens the subform:

Private Sub Form_Activate()
Me.Refresh
End Sub

This doesnt seem to do anything and the first record in the related table is shown. Can anyone tell me the correct code and where to put it?? (Keep it clean ;-)! ) Thanks!
 
Just open your form in design mode.
Drag and drop a new button to your form.
The "Wizard Command Button" screen is now opened.
Choose the appropiate Category and Action.
Select the form you want to open.
Save your changes.

It's best to try out for yourself first....

If you're still having problems, I'll post the basic code you need.

Suc6,

RV
 
Thanks for your reply.
I am using Access 97, not sure if later versions are different.
I used the wizard to create the command button which opens the subform, but the fields are not blank - i need the fields to be blank each time the subform is opened.

Thanks
 
Open the form in Add Mode instead of Edit Mode.

For the form you wish to open,
In form's On_Open event put this code
DoCmd.GoToRecord , , acNewRec


Tess

[This message has been edited by TessB (edited 03-11-2002).]

[This message has been edited by TessB (edited 03-11-2002).]
 
Thanks for that Tess worked brilliantly!!
 

Users who are viewing this thread

Back
Top Bottom