dbTalk Databases Forums  

Re: Get record value from last record

comp.databases.ms-access comp.databases.ms-access


Discuss Re: Get record value from last record in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greg Homyer
 
Posts: n/a

Default Re: Get record value from last record - 08-05-2003 , 08:28 AM






Yep. Read about Send Keys in the help files.

I use the following to automatically enter a Set number in the Set field
when that field gets the focus (Event property - Got Focus), which is picked
up from the same field in the previous record. The same set number will be
entered in the Set field until the user manually overtypes the value. Then
the next new record will use the new value until such time that it is
manually changed again.




Option Compare Database
Option Explicit

'------------------------------------------------------------
' SendKeysSetNumber
'
'------------------------------------------------------------
Function SendKeysSetNumber()
On Error GoTo SendKeysSetNumber_Err

SendKeys "^(')", False


SendKeysSetNumber_Exit:
Exit Function

SendKeysSetNumber_Err:
MsgBox Error$
Resume SendKeysSetNumber_Exit

End Function

--
Greg Homyer

"Lasse Farner" <retro22x (AT) hotmail (DOT) com> wrote

Quote:
I'm new to this, any help gratly appreciated:

When I add a new record in a form, is there a way to have one of the
fields
"inherit" the value of the previous record?

thanks in advance,
Lasse Farner





Reply With Quote
  #2  
Old   
Lasse Farner
 
Posts: n/a

Default Re: Get record value from last record - 08-05-2003 , 10:01 AM






Thanks! Very neat!

"Greg Homyer" <sfive (AT) ameritech (DOT) net> wrote

Quote:
Yep. Read about Send Keys in the help files.

I use the following to automatically enter a Set number in the Set field
when that field gets the focus (Event property - Got Focus), which is
picked
up from the same field in the previous record. The same set number will
be
entered in the Set field until the user manually overtypes the value.
Then
the next new record will use the new value until such time that it is
manually changed again.




Option Compare Database
Option Explicit

'------------------------------------------------------------
' SendKeysSetNumber
'
'------------------------------------------------------------
Function SendKeysSetNumber()
On Error GoTo SendKeysSetNumber_Err

SendKeys "^(')", False


SendKeysSetNumber_Exit:
Exit Function

SendKeysSetNumber_Err:
MsgBox Error$
Resume SendKeysSetNumber_Exit

End Function

--
Greg Homyer

"Lasse Farner" <retro22x (AT) hotmail (DOT) com> wrote in message
news:bgo8r5$bnb$1 (AT) troll (DOT) powertech.no...
I'm new to this, any help gratly appreciated:

When I add a new record in a form, is there a way to have one of the
fields
"inherit" the value of the previous record?

thanks in advance,
Lasse Farner







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.