Code for copying data (1 Viewer)

davey3389

Registered User.
Local time
Today, 22:34
Joined
Jul 16, 2012
Messages
30
Hi everyone,

Basically I'm creating a database and what I have is a field called "
Postcode" in a form labelled "Address"

When you type in the postcode and click the search button it opens a new form, "Postcode lookup", with all the address associated to that postcode

Is there a code so i can click a button next to the address I want and copy the data into the relevant fields from the "postcode lookup" to the "address" form

The fields I have are Building number, street and town on both forms

Thanks guys,

Ben
 

pr2-eugin

Super Moderator
Local time
Today, 22:34
Joined
Nov 30, 2011
Messages
8,494
How is the Lookup data returned back to you? I hope in a listbox? If so, Why not in the Double click of the event, have the
Code:
Form!addressForm!houseNumberField = Me.ListBoxName.Column(0, Me.ListBoxName.ItemSelected)
 

davey3389

Registered User.
Local time
Today, 22:34
Joined
Jul 16, 2012
Messages
30
Basically there is a button that open a new form to show records where the postcode fields match
 

pr2-eugin

Super Moderator
Local time
Today, 22:34
Joined
Nov 30, 2011
Messages
8,494
Okay how does the opening form (Post code Lookup) have the list of address?

If for example if you type in a postcode there will be more than one address related to that address considering it is a UK address. If you look into this thread.. Harrison posted a free UK Postcode lookup that will have a list box that displays all related addresses.
 

davey3389

Registered User.
Local time
Today, 22:34
Joined
Jul 16, 2012
Messages
30
The form opens up in a list that shows all related postcodes
 

Users who are viewing this thread

Top Bottom