Data Entry automate procedure

Joanna_gr

Board Regular
Joined
Feb 16, 2002
Messages
149
Hi all! I hope you may help me on this. I would like to automate a bit the data entry procedure. That is: I have a list with company contacts and I created an entry form for new contact persons. I need to find a way, when I have to enter more than 1 person for the same company in some way automatically enter the address details than write them again and again. Any idea please?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi Joanna

It sounds like you need to normalise your database. What this means is this : if you have multiple contacts for each company, rather than entering the company details all over again for each contact, you split the data into 2 tables - 1 for the companies and 1 for the contacts and link them using a 'foreign key' in the contacts table, like this :

tblCompanies
Company_id {unique key}
Company_name
Comapny_address1
..
Company_address4
..etc..

tblContacts
Contact_id {unique key}
Contact_Company_Link {foreign key, linked on a one-to-many relationship with tblCompanies.Company_id - see Tools -> Relationships}
Contact_Name
Contact_Phone_DDI
..etc..

When you set-up the data entry screens, you could either have separate forms for the companies and contacts or you can combine both into one form with a subform (this would entail having the company details in the main form and the contact details in the subform, and would provide what you asked for).

Here is a thread on database normalisation that might give you some guidance.

HTH, Andrew :)
 
Upvote 0
ouch! This sounds that I'll have to do the work from the beginning. I new that I was missing something! Feel like an idiot. I've almost finished my project. If I split now the tables I'll have to rebuild all the queries etc... hmmm. Ok. anyway. Thanks for pointing this out to me. :)
 
Upvote 0
Joanna

I think that if you follow andrew's suggestion in the long run you will have a far more efficient and manageable database.
 
Upvote 0
well i'm stuck! :cry: ok! I have two tables one with company's details and one with the contacts. I have a form with the companies and a subfom with contacts. relation is the ID field. what is next. How do I join them so to add a new contact without having add the company again??
 
Upvote 0
In your main form design, reduce the screen size so you can see the database window behind, click and drag the subform onto the detail section of the main form - this should invoke a subform wizard.
HTH, Andrew. :)
 
Upvote 0
I'm not disagreeing with Andrew, but there is also a nifty approach that requires no new forms, but a touch of VBA code. You can add a button that says "clone record":
Code:
Private Sub cmdCloneRecord_Click()
    Dim sCloneVals(50) As String	'hoist to make available elsewhere
    sCloneVals(1) = Me.Name
    sCloneVals(2) = Me.Address1
    sCloneVals(3) = Me.Address2
    etc.
    DoCmd.GoToRecord , , A_NEWREC
    Me.Name = "New record"
    'Me.Name = sCloneVals(1) 'would clone the name as well
    Me.Address1 = sCloneVals(2)
    Me.Address2 = sCloneVals(3)
    etc.
    DoCmd.DoMenuItem A_FORMBAR,A_FILE,A_SAVERECORD,,A_MENU_VER20
End Sub
Give regard to whether null fields are allowed, and if any key fields are being cloned, whether they are required to be unique.

I'm surprised so few seem to use this approach, because of the immense data entry savings.
 
Upvote 0
Thanks Andrew! I've already found how to do it and finished with it. Gates thanks for the code but too late! :rolleyes: I followed Andrew's advice and I will not change my project again. I got so dizzy trying to put everything in order again that I don't dare to change anything... :biggrin: Thanks anyway. I'll have the code in mind for a future need.
 
Upvote 0
Joanna_gr said:
I got so dizzy trying to put everything in order again that I don't dare to change anything
Do yourself (or the poor fellow who follows your footsteps) by making a flowchart while it's fresh in your mind. A flowchart doesn't have to be the cryptic boxes and circles that some I.T. people go wild with; it can be just a functional description in your own language that describes what's connected to what, and why. It may not be worth 2 hours effort (although it might be) but I'll bet that in just 7 minutes you can explain some crucial details. You might even include http://www.mrexcel.com/board2/viewtopic.php?t=142338 in your documentation :wink:
 
Upvote 0
Gates > that sounds a good idea! I already wonder If It was me who built this database. sometimes even I forget what is connected to where... lol It's the first time that I created something that needs manual to explain to myself... how it works! :LOL: And it's just a simple contacts base...
 
Upvote 0

Forum statistics

Threads
1,221,907
Messages
6,162,777
Members
451,788
Latest member
Hideoshie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top