Help Me!! Reseting/ clearing a subform

Juggy

New member
Local time
Today, 21:10
Joined
Oct 2, 2003
Messages
7
Hi Guys,

I have a subform (studentGrade) which is visable when the user presses a button. When this subform appears it brings back the data that had been selected before. Is there a way of clearing this data so that when the subform appears it is blank and is reset ???

Can anyone provide me with some code or point me in the right direction that would be great guys!!

Appologies if this subject has been done before!

Regards

Juggy
 
Is this form used for data entry only? If so, you can set the Data Entry property to yes for the form (or subform).

Otherwise, you can put somewhere in your form (in the Got Focus event maybe) the code for going to a new record, which will always create a new record thereby clearing out all fields.

DoCmd.GoToRecord ,(YourFormName) , acNewRec

Just a thought. I've used something similar before, though I'm not sure whether I've ever used it in a form/subform relationship.
 
Many Thanks for your reply to my query Mrs Gorilla :D
The data entry option that you suggested works only when you start the whole form from the beggining. When you press the 'save' button the form should take all the data in the subform and store it into a table (which it does) and take all this data from the screen so that new data can be added. But at the moment this data does not go away and is still on the form. I have tried the DoCmd.GoToRecord ,(YourFormName) , acNewRec which you suggested but that does not seem to work either!. Please excuse me as I am a novice at Access and VBA but do you have any other ideas??


Kind Regards Juggy
 

Users who are viewing this thread

Back
Top Bottom