Best Way To Pull Last Record Data?

  • Thread starter Thread starter Chaster
  • Start date Start date
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
 
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
 
Back
Top