Best Way To Pull Last Record Data?

C

Chaster

I want to enter data into a table named Payables from my Form NewPayable.
The fields on my form are bound to [VendorID], [InvoiceNum],
[FCRefNum],[Amount]

If a vendor sends us an invoice with multiple line items we enter the 1st
record
[VendorID] ="ATE"
[InvoiceNum] = 512755
[FCRefNum] = 22220076
[Amount] = $198.57

I have a cmdbtn cmdSame.

I need help with the procedure to run on click of cmdSame

I want to add a new record
put in the same [VendorId] from the previous record "ATE"
put in the same [InvoiceNum] from the previous record 512755
set focus to [FCRefNum]

Should be simple but I am having a brain fart on this

TIA
 
G

Gary Miller

Chaster,

Basically you want to pickup the values from the first record, go to a new
record and then poke the values in.

Here is some air code off the top of my head that assumes that Invoice
Number is actually a number field.
****************************
Dim strID as String, lngInvNum as Long

strID = Me!VendorID
lngInvNum = Me!InvoiceNum

docmd.GoToRecord ,,acNewRec

Me!VendorID = strID
Me!lnvoiceNum = lngInvNum

*********************************

Gary Miller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top