Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thought I was cool with On_Current 1

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
0
0
US
I have the following on a form with a subform:

Private Sub Form_Current()
If IsNull([txtDocNum]) Then
Me.frmDocumentSubform.Enabled = False
Else: Me.frmDocumentSubform.Enabled = True
End If
End Sub

I thought it was working, but when I do enter a DocNum, it doesn't release the subform without changing records first.

How do I do this? Besides an AfterUpdate in DocNum? Shouldn't I be able to do it in On_Current? To make sure a DocNum isn't entered, then erased later, which would unlock the subform?

Thanks. Sean.
 
Sean:

The OnCurrent event does not trigger until you move from the current record or close the form. So you'll have to settle for either triggering the OnCurrent event from the DocNum AfterUpdate event, or add that bit of code to the DocNum AfterUpdate event as well as the OnCurrent event.

If your OnCurrent event has significant code, it would be best to add that bit of code to the DocNum AfterUpdate event, than to have the OnCurrent run through code not yet required.

HTH,

Vic
 
Good solid advice VicM. AfterUpdate it is then.

Thanks. Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top