Rabu, 04 April 2012

[MS_AccessPros] Re: Add value from Previous record

 

Art

Private Sub Form_Current()
Dim rs As Object
Set rs = Me.Recordset.Clone

If rs.EOF Or Not Me.NewRecord Then
' don't do anything if there's no records or it is not a new record
Else
With rs

.MoveLast

Me![City] = .Fields("strCity")
Me![PostalCode] = .Fields("strPostalCode")
Me![Region] = .Fields("strRegion")
End With

End If

End Sub

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile/Bill.Mosca

--- In MS_Access_Professionals@yahoogroups.com, "Art" <dbalorenzini@...> wrote:
>
> I have a button called cmdNewWorkOrder on a form called frmWorkOrderDetails. Currently the code for the button is as follows:
>
> Private Sub cmdAddWorkOrder_Click()
> DoCmd.GoToRecord , , acNewRec
>
>
> End Sub
>
> But what I need to do is pass the value of UnitID from the previous record to the new record while the form is still open.
>
>
> Please advise.
>
> Thank you
> Art Lorenzini
>

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar