Blank fields on opening form

Graham Bucknall

Registered User.
Local time
Today, 07:53
Joined
Feb 28, 2002
Messages
28
I have a form for editing some details of firms (combo box in header etc). When I open it from a switchboard there is always data in the main fields (not the combo box). I don't want to add a new record but I would like it to be blank ready for me to choose the firm I want from the combo box.

How do I go about this?:confused:
 
In the forms OnOpen event, have the fields invisible and in the AfterUpdate event of the ComboBox make them visible.

IMO
 
Thanks for that but how do I do it - is it by creating a macro and, if so, do you have a sample macro or the lines for it?
 
In design view goto the forms properties and select "On Open". From the Dropdown in the properties box select "Event Procedure". Now Click to the right of the dropdown to open the code window. Between the lines "Private Sub Form_Open(Cancel As Integer)" and "End Sub" type in code like this...
Code:
Me.YourTextBox.Visible = False
'YourTextBox' being the Name of the Text Box you want to hide. List all of them you want hidden in the same way. Now go to the properties of the combo and select "After Update". Open the code window in the same way as before and enter the list of your text boxes changing 'False' to 'True'.
Code:
Me.YourTextBox.Visible = True
Hope this helps

IMO
 

Users who are viewing this thread

Back
Top Bottom