Clear Form on entry

Stemdriller

Registered User.
Local time
Today, 06:22
Joined
May 29, 2008
Messages
187
I have a query that basically pulls up client data through a form (You select Clients surname via Combo Boxon a form)

This all works fine but when the form opens there is already a record on the form and I would like the form to be clear until an name is selected in the combo box.

I have had this before but cannot for the life of me remember how I got around the problem.

Any help would be great

Thanks
Stem
 
Set DataEntry True in the OnLoad event and change it in the GotFocus event of the ComboBox.
 
Set DataEntry True in the OnLoad event and change it in the GotFocus event of the ComboBox.

Doing thats indeed blanks all the text boxes and allows me to select from the Combo box but no longer populates the text boxes once I have selected a client from the combo
 
Did you change the DataEntry property to False in the GotFocus event of the ComboBox?
 
Did you change the DataEntry property to False in the GotFocus event of the ComboBox?

Nope still not happening.
Last time I had this issue I made all the text boxes invisible except the combo box, until the Combi was populated then made the text boxes visible.True

Was kinda hoping for a easier solution though.
 
Add a Me.Requery after you change the DataEntry property.
 
This is the code thus far


Private Sub Combo103_GotFocus()

DataEntry = False

End Sub

Private Sub Form_Load()

DataEntry = True
Me.Requery

End Sub

I have never used a 'ReQuery' before. The above code still not working. The combo box does no longer list either?
 
My bad. I should have said add the Me.requery in the GotFocus event. :(
 
wait a second...
do you want the form to be used to enter a new record only ? this is what the DataEntry property RuralGuy is talking about.
 
It is purely to select a client from a combo box, then if you select for example Smith, John then all his address, phone etc etc will be displayed.
 
yea, that's what I thought you'r after.
there are few ways to do that.
I think the best one will be to put all your data on a sub form.
on the main form put a combo box.
the subform will be linked to the main tform based on your selection.
as at first nothing selected the sub form will be empty
 
RuralGuy, I did try your suggestion in 8, but still to no avail.

I will try the form way.

Thanks
 

Users who are viewing this thread

Back
Top Bottom