Clear Fields..

MikeUK

Registered User.
Local time
Today, 13:39
Joined
Dec 14, 2000
Messages
36
hi every1,

i have a form which data is entered into, but i need a button to refresh the fields to be blank again.

i tried some code which closed the curren form then opened the same one again, but i got errors.

any1 have the code the refresh the form? im all out of ideas!
 
Cycle through the controls container for the subject form, and for each controltype you want to reset it to null.

an over-simplified method follows:

dim ctl as control
Form each ctl in screen.activeform
if ctl.controltype = acTextbox then ctl.value=""
if ctl.controltype = accombobox the cftl.value=""
etc.
next
 
sorry not quite sure what ure trying to say there mate :S
 
If the form is bound to a query or table then clearing the data will clear the record ....

Is this what you want to do ???
If .. Yes ... then use the "Undo" method to clear the record.

If you just want to go to a new record .. execute:

DoCmd.GoToRecord , , acNewRec

HTH
RDH
 
ah, i think i should have told u about the fact im not using access, just VB!!

i just need a button which when pressed clears all the data entered onto the form, i dont think the data is stored anywhere, im just creating a HCI.
if i was using access i could just use a button wizard beacause the data is stored in a table and i could just clear the fields.
any thoughts?
 

Users who are viewing this thread

Back
Top Bottom