Making all fields blank when form is loaded

  • Thread starter Thread starter visionstate
  • Start date Start date
V

visionstate

Hi there,
This is probably quite simple but i just can't work it out!
Basically, I have a form with 2 text boxes, 1 combo box and a sub form
(which reads from a query. The query reads from a table).
What I'd like to do is, when the form is loaded, for the text boxes and
combo boxes all to be blank but the subform to display all the values
of the query it is loading from.
This is fine the 1st time you open the form, but if you close it, then
open it again, it retains the values that were last entered and hence
changes one of the entries in the query to what the last entry was in
the combo box.
For instance, if the top (1st entry) employees department in the query
is 'Finance' and you do a search the 1st time you open the form and
choose say 'Admin' from the combo box, close the database. The next
time you open, the first entry for the top employee has changed from
'Finance' to 'Admin'. I tried using the 'Null' or ' ""' arguements in
the form load events but this then blanks the top entry employees
Department thus leaving no value at all.
Any help is greatly appreciated!
Thankyou.
 
When you "close" and "open" the form, are you actually switching between
design view and form view? If so, try closing the form completely then
opening it.

Are the controls on the main form bound or unbound? If you close the form
completely and the controls are unbound, they should not remember their last
value. If they are bound, they will show the value of the first record as
you open the form.
 
Hi Wayne,
Thanks a lot for your reply.
The combo box, I believe, is bound because it gets its data from a
query. Is this correct?
The text boxes are unbound.
How would I go about unbounding the combo box?

It is physically being closed rather than going back into design view.
Thanks again.
 
The combo box is "bound" if there is a field listed in its Control Source. A
query in the Row Source does not make the combo box bound.
 
Back
Top