Copy and Paste from Forms

N

Neil Greenough

I recently posted this thread but got no replies, so thought I would try
again.

I created an autoform for a table and then decided to copy and paste
everything from the table into a new table that was customised to my design.
Nonetheless, in each of the fields in the table, I have the message #NAME?

I have checked the ControlSource and it is listed as the source in the
table, however I don't think it is linking the fields to the table.

Any ideas how I can fix this? I have tried to do it through 'build' on the
control source, but didn't quite know what I was doing.

This is quite important and so any help would be much appreciated

Thanks :)
 
W

Wayne Morgan

The Control Source of each control on the form points to a field in the
form's Record Source. Did you change the form's Record Source to point to
the new table? If you are using a query between the form and the table, did
you put the new table in the query and change the table name for each field
that now uses the new table?
 
N

Neil Greenough

Many thanks for the prompt replies.

When I have tried to change the control source, there are no other fields
listed in the dropdown menu, although there are 10 in the respective field.
Subsequently, I think it has lost the link somewhere along the line.

If there is no fields listed in the control source, how can I locate it? I
have tried 'build' in the control source, then selecting the correct table
and field and get something like, [tblEmployees][EmployeeID], but yet still
get error #NAME?

There is no query and is simply a form to a table. If you create a simple
table then autoform and then copy and paste everything from the autoform to
a new form, you'll see what I am getting :)

Thanks once again
 
W

Wayne Morgan

In the same place that you find the Control Source for the controls, if you
click the little box in the upper left corner of the form in design view
(where the ruler bars come together) the Properties sheet will now show the
properties for the form itself and Control Source will become Record Source.
This needs to be the name of the new table.
 
N

Neil Greenough

Wayne, Could you elaborate a little more on this?

I have gone into edit mode on my form, clicked in the relevant object
(field) and then went to the dropdown menu under 'File.' Nonetheless, when I
click on the respective one, it is still the same as the previous one.


Wayne Morgan said:
In the same place that you find the Control Source for the controls, if
you click the little box in the upper left corner of the form in design
view (where the ruler bars come together) the Properties sheet will now
show the properties for the form itself and Control Source will become
Record Source. This needs to be the name of the new table.

--
Wayne Morgan
MS Access MVP


Neil Greenough said:
Many thanks for the prompt replies.

When I have tried to change the control source, there are no other fields
listed in the dropdown menu, although there are 10 in the respective
field. Subsequently, I think it has lost the link somewhere along the
line.

If there is no fields listed in the control source, how can I locate it?
I have tried 'build' in the control source, then selecting the correct
table and field and get something like, [tblEmployees][EmployeeID], but
yet still get error #NAME?

There is no query and is simply a form to a table. If you create a simple
table then autoform and then copy and paste everything from the autoform
to a new form, you'll see what I am getting :)
 
W

Wayne Morgan

With the form open in design view, go to the Properties sheet (click the
Properties button on the toolbar or go to View|Properties), choose Form in
the drop down on the Properties sheet. Go to the Data tab and set Record
Source to the name of the new table.
 
N

Neil Greenough

Hiya Wayne,

Thanks and all kind of seems fine :)

I have managed to change the Record Source to the table, however this now
sets it for all of my tabbed sheets, and each sheet has a different table
source, but this method won't allow me to see different record sources

Any ideas?
 
W

Wayne Morgan

For a basic setup, there should be only one Record Source for a form. If you
need to draw data from more than one table there are some options.

1) Use a query as the Record Source with the multiple tables in the query.
If the query isn't designed properly, this may not result in an updateable
recordset.

2) For you few controls that need data from elsewhere, make them calculated
controls using DLookup.

3) For combo boxes and list boxes, the Row Source (the part that fills the
list) is frequently a different record source. You then bind one field (a
unique field) from this record source to be stored in this form's Record
Source.

4) Use subforms. The subform is usually from a Record Source that is the
many side of a one-to-many relationship with the main form's Record Source.
 
Top