Copying Records

kevsim

Registered User.
Local time
Tomorrow, 03:56
Joined
Aug 10, 2002
Messages
34
I have a database where some of the records are very near the same as other records and it can be quite tedious when inserting the data. To save time when typing in a new record, I choose a record close to the one I want to type in, then press a command button for the data to be copied in the controls of my new record. This works very well, except 2 of my controls are Text Boxes bound to a Memo field. When the data is copied in and the memo field being copied is long, not all the data appears in my new memo field record. I have eliminated the” >” in the memo fields format. I am using a combo box to obtain all the required fields with the following code to move the data,-
F!Text11 = F!Combo15.Column(2)
F!Text13 = F!Combo15.Column(3) etc;
I have been told by using the combo box method of picking up the data, I can only obtain 255 characters.
How can I obtain all the data from the memo field being copied. I would appreciate your advise.
Kevsim
 
add the Unique Id as a column of the Combo box and use the DLookup function to retrieve the Memo Field.
 
Travis, Thanks for the info, I will try it out.
kevsim
 
I prefer the control my method below offers because I do not always want all fields duplicated. Follow my example to do what you want.

Dim sFirstName As String
Dim sLastName As String
Dim sMailingLocation As String
Dim sPhoneNumber As String

sFirstName = FirstName 'FirstName is the name of the table field
sLastName = LastName
sMailingLocation = MailingLocation
sPhoneNumber = PhoneNumber

DoCmd.GoToRecord , , acNewRec

FirstName = sFirstName
LastName = sLastName
MailingLocation = sMailingLocation
PhoneNumber = sPhoneNumber

sFirstName = ""
sLastName = ""
sMailingLocation = ""
sPhoneNumber = ""

If your fields might have nulls, search this forum for my user name "ghudson" and the keyword "duplicate" for I have a sample db here that will take care of the nulls.

HTH
 
ghudson, thanks for the info, I will try it.
kevsim
:)
 

Users who are viewing this thread

Back
Top Bottom