Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying data between forms

Status
Not open for further replies.

stevefutcher

Technical User
Oct 31, 2007
13
0
0
GB
Hi

I have to have two tables for sites and master addresses, as the occupier of the site may change with time and we need to keep historic records.

I have two forms, one based on the sites table and one on the master address table.

When a user enters a partial address in the sites form, they can then open the other form which displays the master address data matching the criteria.

I want them to select the appropriate address from the list, which will then copy all the address information and the unique property reference into the first form.

I have tried

Code:
Dim UPRN As Double
Dim NameNum, Street, Locality, TOWN, POSTCODE As String

UPRN = Me.UPRN
NameNum = Me.SAON_AND_PAON
Street = Me.Street
Locality = Me.Locality
TOWN = Me.TOWN
POSTCODE = Me.POSTCODE

frmSites2.fldSitesUPRN = UPRN
frmSites2.fldSitesPropNameNum = NameNum
frmSites2.fldPropStreet = Street

but this gives me a run-time error.

any ideas
 
So you'll have duplicate data in two tables. This is against normalization which is a protocol of relational databases of which Access is one. And it's not needed if your tables are constructed correctly by following the rules of normalization. It seems you do not have a well design database. You may want to reevaluate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top