Kamis, 20 Oktober 2011

[MS_AccessPros] Event at the end of all entries on form including subforms?

 

I want to remind the user to enter the Market Value for the current year if they have entered the selling price and date and have not entered the Market Value. The selling price and date are entered on the Sales form and are elements of the sales table. The Market Value is a separate table and a subform for it is on the Sales form. Ideally I would like the code to engage after the user has entered all the data she thinks is needed. The Market Value subform is the last in the tab order. So the user first enters the Sales table date, then the ListingContacts subform,and the Buyers subform before getting to the Market Value table. Is there any event that fits this???

I am wanting to do this since finding that if the last years Market Value was the same as this years it is often not being entered for the current year which is necessary for accurate data ...

The code is below. I just haven't found the right event to use it in. May need to change it--Dlookup finds the first entry not all of them, right? But my question above is still applicable

thanks!
Connie

If Not IsNull(Me.SoldPrice And Me.SoldDate) And DLookup("MVYear", "MarketValue", "HomeInfoID = " & Me.HomeInfoID) <> Year(Date) Then
Msgbox "A 2011 Market Value should be entered." _
& vbNewLine & "If you don't have it, enter this as a task on the Access To Do list."

If Not IsLoaded("Listings") Then
DoCmd.OpenForm "Listings", , "ListID = " & Me.ListID
Else:
DoCmd.FindRecord (Me.ListID)
End If
End If

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar