Add additional field to Access form using a button

troybos

New member
Local time
Today, 14:00
Joined
Sep 23, 2009
Messages
1
I have an Access form that contains contact fields from the db. There are 4 contact fields in the db. I am only showing one of those contact fields on the form and would like to have a button, or some other control on the form, that would allow me to add the next contact field to the form if needed. Is there a way to do this?

Also, I would need to auto resize the form after adding more fields (up to 3 additional contact fields).

Thanks
Troy
 
I have an Access form that contains contact fields from the db. There are 4 contact fields in the db. I am only showing one of those contact fields on the form and would like to have a button, or some other control on the form, that would allow me to add the next contact field to the form if needed. Is there a way to do this?

Also, I would need to auto resize the form after adding more fields (up to 3 additional contact fields).

Thanks
Troy
Sorry to be the bearer of bad news. You have a very badly designed database there. For a PROPERLY designed, and normalized database, you don't add fields, you add records. I think we should visit your table structure and ensure it is correct before moving on.
 
I cannot think of a way to add fields and resize the form, but could you not add the additional contact fields into the form but use code to hide them and then unhide them when a checkbox is checked perhaps?

Something along the lines of-

In the forms Current event:-
Code:
Me.ContactField2.Visible = False
Me ContactField3.Visible = False
Me.ContactField4.Visible = False

Then create 3 checkboxes, 1 next to each of the Contact Fields and in each checkboxes AfterUpdate event use:-

Code:
If Me.Checkbox1 = True Then
Me.ContactField2.Visible = True
Me.ContactField2.SetFocus
End If

obviously changing the checkbox and control name as applicable to each.

I don't know if this will work, but might be worth trying. The only problem being that there would be some blank space where the hidden controls are.
 

Users who are viewing this thread

Back
Top Bottom