Rabu, 20 Juli 2011

[MS_AccessPros] Conditionally undoing textboxes or comboboxes using close button on another form

 

I have a form TrackingSpreadsheet with a field ListIDPropertyName which for the NotInList event opens the Listings Form. When I close the Listings form I am using code which checks to see if the TrackingSpreadsheet is loaded and if so it undoes the last record in The TrackingSpreadsheet form and requeries several comboboxes.

I have a couple of questions:

I would prefer to check to see if ListIDPropertyName is dirty and undo that box only. Is there a way to do that?

Is there a way to requery all comboboxes that were dirty so that all additional info is added rather than list the comboboxes to be requeried?

The code is below

Thanks!
Connie

'If TrackingSpreadsheet is open, set focus on it
If IsLoaded("TrackingSpreadsheet") Then
Forms!TrackingSpreadsheet.SetFocus
If Forms!TrackingSpreadsheet.Dirty = True Then
Forms!TrackingSpreadsheet.Undo
End If
Forms![TrackingSpreadsheet].ListIDPropertyName.Requery
Forms![TrackingSpreadsheet].FNames.Requery
Forms![TrackingSpreadsheet].ListIDAddress.Requery
End If

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar