Copy Form data

bretdunlap

Registered User.
Local time
Today, 12:24
Joined
Nov 15, 2011
Messages
54
Hi

I have a form and a button it to copy the data to save me time when 99% is duplicated Ie If I enter 2 siblings data I fill one out then copy it and only change the siblings name a bdate.

Then problem is it does copy the data but locks up the form. I have t X out the form when I do a warning comes up asking me if I want to empty the clipboard of, in short, a massive amount of data. I say yes and then reopen the form and there is the duplicate data ie 2 records. It works but isn't clean any thoughts/suggestions.

Private Sub Command163_Click() 'Coppy record Button
On Error GoTo Err_Command163_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_Command163_Click:
Exit Sub

Err_Command163_Click:
MsgBox Err.Description
Resume Exit_Command163_Click

End Sub
 
does any one have an idea?

You're not going to like what I say. It sounds like your table structure is not quite right and is not properly normalized. But I can't tell for sure without seeing the table structure. I am guessing you have repeating fields for siblings and such, is that correct? If so, that confirms my suspicions.
 
Repeated fields when I copy it ? every thing is repeated if that is what you are saying I have a unique field in the id but I don't generate that until after I change the name of copied record ie I copy john smith then open it up and change it to sally smith then I hit a button the creates a unique ID that is a combination of name and phone number.
 
Basically I was doing this to save me time re typing 90% of the info
 
"not quite right and is not properly normalized" in what way
 
"not quite right and is not properly normalized" in what way

Siblings should not be fields in the table. It should be RECORDS. So, somewhat like this:

tblPersons
PersonID - Autonumber (PK)
FName
LName
etc.

tblRelationType
RelationTypeID - Autonumber (PK)
RelationDesc (like Child, Spouse, Self, etc.)

tblPersonsRelations
PersonID - Long Integer (FK)
RelatedTo - Long Integer (FK) 'also a PersonID
RelationTypeID - Long Integer (FK)
 
I don't have any of that just a basic table with data the auto number changes when I cop it and the student Id is unique but I only make the Id after I have copied the file.
 

Users who are viewing this thread

Back
Top Bottom