Tags: access, carry, database, datafrom, entry, fields, form, function, ina, microsoft, mysql, oracle, previous, repeat, sendkeys, sql

Repeat last entry

On Database » Microsoft Access

2,450 words with 2 Comments; publish: Mon, 31 Dec 2007 00:04:00 GMT; (25078.13, « »)

I have several fields on a form that may need to carry over the data

from the previous entry. At the moment I have SendKeys "^"(')",True in

a function. This function is then called in the various fields that

need it. However, I now understand that the use of SendKeys is

questionable. I look after about 15 DB's with this code in it and

would like to avoid any trouble, as we intend to migrate from Access

97 to Access 2000. Is there any other code I could use in its place?

Bearing in mind that not ALL the fields on a form need the data

duplicating in the next record.

David

All Comments

Leave a comment...

  • 2 Comments
    • I would use a button with an event that saves the content from the

      desired fields or text boxes into Dim'd variable(s) and then drop it

      (them) in where it (they) belong.

      You didn't specify that you're copying data between records, but I

      expect you are. If so, you should be able to use

      DoCmd.GoToRecord acActiveDataObject, , acNext

      or - more likely to be useful -

      DoCmd.GoToRecord acActiveDataObject, , acNewRec

      and then drop the value into the appropriate text box.

      Of course you'll set up several variables for these as needed, and drop

      the values in where they belong. Works like a charm.

      You do have to take care of any required fields or invalid data, or any

      situation in the record you're leaving that isn't allowable before you

      move to the next record.

      Bruce Pick

      David Neagle wrote:

      > I have several fields on a form that may need to carry over the data

      > from the previous entry. At the moment I have SendKeys "^"(')",True in

      > a function. This function is then called in the various fields that

      > need it. However, I now understand that the use of SendKeys is

      > questionable. I look after about 15 DB's with this code in it and

      > would like to avoid any trouble, as we intend to migrate from Access

      > 97 to Access 2000. Is there any other code I could use in its place?

      > Bearing in mind that not ALL the fields on a form need the data

      > duplicating in the next record.

      > David

      #1; Mon, 31 Dec 2007 00:06:00 GMT
    • Thanks Bruce. I hadn't thought of that method. I will give it a try.

      David

      *** Sent via Developersdex http://www.developersdex.com ***

      Don't just participate in USENET...get rewarded for it!

      #2; Mon, 31 Dec 2007 00:07:00 GMT