Re: button created to copy and paste a field
Had a peek. No Data? Some of the things I noticed...
1. "Name" is a reserved word, changed Control to txtName.
2. "Mr/Mrs/etc" is an improper field/control name, changed to NameTitle.
3. Modified your Copy Address Command - proper Control Name, and data validation.
4. For filling txtName, need to check OnCurrent Event AND Afterupdate of Company & Contact.
5. On cmdCopyAddress, merged validation into (1) message to display all missing Control Names.
6. Modified form Cycle Property to Current Record, so Tabbing doesn't go to next record.
7. Not sure what the OK/Cancel buttons are supposed to be doing -- no code behind them.
Okay, that gets you past your current issue, But... While the forms does work for want you (may) want, it is not logically designed, nor is your data Normalized.
You should using Naming Conventions for object names (Search online for Reddic Naming Conventions).
Your data should not be in just one table. You should break that up into separate entities. As a start, some of these might be:
tblCustomers
------------
Customerid, AN PK
CustomerName, Text
WebPage, Text
EmailAddress, Text (Main email)
...
DateEntered, Date/Time
IsActive, Yes/No
...
tblCustomerCategories
---------------------
CustomerCategoryID, AN PK
CustomerID, Number FK
CategoryID, Number FK
tblCategories
------------------
CategoryID, AN PK
Category, Text
tblCustomerAddresses
--------------------
CustomerAddressID, AN PK
CustomerID, Number FK
AddressTypeID, Number FK
Address1, Text
Address2, Text
City, Text
Province, Text
PostalCode, Text
Country, Text
DateEntered, Date/Time
IsActive, Yes/No
tblAddressTypes
---------------
AddressTypeID, AN PK
AddressType, Text (Default, BillTo, ShipTo, etc.)
tblCustomerContacts
-------------------
CustomerContactID, AN PK
CustomerID, Number FK
NameTitle, Text
NameFirst, Text
NameLast, Text
NameMiddle, Text
DateEntered, Date/Time
IsActive, Yes/No
tblCustomerComments
---------------------
CustomerCommentID, AN PK
CustomerID, Number FK
Comments, Memo
DateEntered, Date/Time
tblContactComments
---------------------
ContactCommentID, AN PK
ContactID, Number FK
Comments, Memo
DateEntered, Date/Time
You may also want to provide "Type" tables for City/Province/PostalCode/Country. This is just a start... Your requirements may (likely) dictate changes. If you get to a point where you are unsure about the Table Structures, post what you have up to that point in the Database Design forum and other AWF members will gladly review it for you.
MS Access works very well when the information is separated to their own entities and then correctly related to each other (Relational Integrity). It may look like alot of work right now -- and it SHOULD be! Database Planning/Designing usually takes MOST of the project time. If done right, the rest (User Interface, reports, code) comes easy. Have a search here for "Normalization" or on the Web. Plenty of information available.
I realize the above is alot, but you will be happier to have gone the route above than continuing to create code to work around flaws in database design.
Good luck!
