Rabu, 04 April 2012

Re: [MS_AccessPros] Re: Add value from Previous record

 

I am going to put a snapshot up of my form in the folder Assistance Needed to give you a better idea of what is going on. I am probably asking my question wrong.
 
The user has opened a specific work order for a specific UnitID. Now if they click add Work Order then I need it to pass the unitID to the new record. I probably worded my question wrong because the previous record might not have the correct UnitID I think I meant to say the Current record.

With warm regards,

Arthur Lorenzini
Sioux Falls, South Dakota

________________________________
From: Bill Mosca <wrmosca@comcast.net>
To: MS_Access_Professionals@yahoogroups.com
Sent: Wednesday, April 4, 2012 11:46 AM
Subject: [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
>

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar