Changing form

  • Thread starter Thread starter Greg Jesky
  • Start date Start date
G

Greg Jesky

I have a simple "update form". It works fine for what I am doing.
However I modified the underlying table to add a drop down box that I
thought would appear in my form (allow for easier update of information).
The "update form" does not include the drop down box that was added to the
underling table.
How do I get the change to the underlying table reflected in the form
without recreating the form.
I have looked through "help" and can not find a description.
Thank You,
Greg
 
It's possible that the form's RecordSource is a query and not the table
itself. If this is the case, you'll need to add the new field to the query
for the form to see it.
 
Bob,
Thank you.. I built the form using the "create form by using wizard"
directly from a table. Any other ideas??
Thank you,
Greg
 
Bob,
Thank you.. I built the form using the "create form by using wizard"
directly from a table. Any other ideas??

Just two comments:

- Your Table *does not contain a combo box*.

A combo box is a display tool. It is not data. Most developers avoid
the Lookup Field misfeature introduced in A2000 - see
http://www.mvps.org/access/lookupfields.htm for a critique.

Adding a new field (whether it's a lookup field or not) to a table
will not automagically add a new control to a Form. Tables are not
Forms; a form is just a customizable window onto the data in a table.
What you'll need to do is:

a. Open the Form in design view; click the "Field List" icon on the
toolbar.
b. If your newly added field appears, go on to step e.
c. If not, view the form's Properties and click the ... icon by the
Recordsource property (on the Data tab). This will open a query design
view window of the form's recordsource.
d. Add tne newly created field to the query. It will display the
(hidden, by the blankety-blank Lookup combo box) numeric value which
is actually stored in your table.
e. Use the Combo Box tool on the Toolbox, with the magic want
selected, to add a Combo Box to the form bound to the new field. (This
works just as well whether the table shows a textbox or a combo box -
again, the Table is one thing, the Form is a different thing).

John W. Vinson[MVP]
 
John,
Thank you for the advice..
I did not add a new field to my table or form. I did add a pull down menu to
an existing field in my table. I think I now understand the dangers of doing
this. I expected that the form would have detected the change in the
underling table but I guessed wrong.
I created the form again through "Create form by using wizard" and the form
was created as expected.

This does bring to mind a general question-- -- If you have a fairly complex
form and you change an underling table do you need to recreate the form from
scratch or is there a general guideline as to when/what type changes to
underling tables will require you to recreate forms.

Thank you again for your advice.
Greg Jesky
 
in message:

Hi Greg,
John,
Thank you for the advice..
I did not add a new field to my table or form. I did add a pull down menu to
an existing field in my table. I think I now understand the dangers of doing
this.

You might have misunderstood exactly what John was talking about. John
was explaining the dangers of "Lookup Fields." From your description you
said you added a drop down box in the table itself. This is usually frowned
upon by experienced developers as it somewhat *deceives* you as to what
exactly is saved in the record. Making a combo box on a form to select from
a list of items is the preferred method.
I expected that the form would have detected the change in the
underling table but I guessed wrong.

Yes, you guessed wrong. Most changes to tables will not be reflected
in the various other database objects (forms, queries, reports). This is
why it is usually said to "get the tables right" before doing anything else.
Granted there are occasions where a table change is needed, but
hopefully this should be rare.
I created the form again through "Create form by using wizard" and the form
was created as expected.

Whether you manually created the form or made one by the wizard will
still require some modifications if you make changes to the underlying table(s).
This does bring to mind a general question-- -- If you have a fairly complex
form and you change an underling table do you need to recreate the form from
scratch or is there a general guideline as to when/what type changes to
underling tables will require you to recreate forms.

Usually, recreating a new form is not necessary. Sometimes the only thing required
is to delete the existing control on the form bound to that specific field you changed,
re-select that field from the "Field List", and drag a new control onto the form. This
new control will *inherit* whatever changes you may have made. You still may need
to adjust any formatting, tab stop settings, etc. Generally a lot of this just comes
from experience.
 
Greg said:
Bob,
Thank you.. I built the form using the "create form by using wizard"
directly from a table. Any other ideas??

And the wizard likely created a query against that table based on which fields
you chose. The exception might be if you chose "all" fields in which case it
might just use the table name as the form's RecordSource.
 
Greg Jesky wrote:
[snip]
This does bring to mind a general question-- -- If you have a fairly
complex form and you change an underling table do you need to
recreate the form from scratch or is there a general guideline as to
when/what type changes to underling tables will require you to
recreate forms.

There is NEVER a reason to rebuild a form from scratch other than if it gets
corrupted and you have not made any backups. Once you've used Access for a bit
you will likely find little reason to use the forms wizards at all.
 
This does bring to mind a general question-- -- If you have a fairly complex
form and you change an underling table do you need to recreate the form from
scratch or is there a general guideline as to when/what type changes to
underling tables will require you to recreate forms.

Just to agree with and add to Rick and Jeff's comments: no, you do NOT
need to recreate the form. The form design mode is a *very* rich
visual programming environment; it's much easier to add a combo box,
change a textbox to a combo (just right mouseclick it and select
Change To), move controls around, etc. than it is to wipe it all out
and rebuild from scratch. Like Rick and Jeff, I rarely use the forms
wizard; once in a while if I just need a quick & dirty form for my own
use and don't care how it looks I will, but it's only a bit more work
to just create a new form, specify the table or query upon which it is
based, and pull fields from the field list onto the form or use the
toolbox. And when that's done, you have a form that looks the way YOU
want it to look, not how some automated process guesses you might
like.

John W. Vinson[MVP]
 
Jeff, Rick and John,
Thank you for your excellent advice! I appreciate your time and patience,
especially for my dumb questions.
Thank You all again,
Greg
 
Back
Top