Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Value of control to next record in continuous form

Status
Not open for further replies.

oxicottin

Programmer
Jun 20, 2008
353
0
0
US
Hello, I have been trying to figure this out and have no clue how to get the value of the last records [txtLotNumber] into the new record [txtLotNumber] using the button cmdCopyLotDown. I also don't want to show the button on the first record because there is nothing to copy down an it will probably cause an error. I included/uploaded an example of what I have...

Note: I know you can just ctl+c and paste it into the next text box but not everyone knows computers but seeing a button they do know. Also, this is a 12 digit numeric value and wont be used all the time so sometimes they will be typing in the number and sometimes they will be hitting the button.

Thoughts?

Thanks,
SoggyCashew.....
 
 http://files.engineering.com/getfile.aspx?folder=45daaad9-bbe3-431d-9fcf-f61f5ae2bff8&file=Copy_Down_One.accdb
You don't even need a Command Button...you can simply use the AfterUpdate event of the Control holding your data to set the DefaultValue for the Field. From that time forward, until you either manually change the data or close your form, the data will be entered automatically in each New Record.

Code:
Private Sub txtLotNumber_AfterUpdate()
   Me.txtLotNumber.DefaultValue = """" & Me.txtLotNumber.Value & """"
End Sub
This syntax is valid for Text, Number, DateTime and Boolean Datatypes.

Linq ;0)>


Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007
 
@missinglinq thank you I never thought of doing it that way, I'm glad you replied I'll give it a try and see if I like it. Thanks!

Thanks,
SoggyCashew.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top