If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Alternative to AfterUpdate?
I have a form that uses the AfterUpdate event procedure to make several areas
visible or invisible. Example: Private Sub txtFergusonChargeback__AfterUpdate() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub Private Sub Form_Current() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub However, this is not exactly what I'm looking for. Basically, I need for the date to appear if there is any entry in txtFergusonChargeback_, not just after it's updated. What event do I use for that? -- GD |
#2
|
|||
|
|||
Alternative to AfterUpdate?
When your form loads up a record, you want the AfterUpdate event on that
control to fire, right? So you could add something like the following to the Form's OnCurrent event: Call txtFergusonChargeback_AfterUpdate() (by the way, if you've named that control to reflect the underlying field, it would appear you have data -- "Ferguson" -- embedded in your field name. This is not a good idea in a well-normalized relational database.) Good luck! Regards Jeff Boyce Microsoft Office/Access MVP "GD" wrote in message ... I have a form that uses the AfterUpdate event procedure to make several areas visible or invisible. Example: Private Sub txtFergusonChargeback__AfterUpdate() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub Private Sub Form_Current() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub However, this is not exactly what I'm looking for. Basically, I need for the date to appear if there is any entry in txtFergusonChargeback_, not just after it's updated. What event do I use for that? -- GD |
#3
|
|||
|
|||
Alternative to AfterUpdate?
So, instead of repeating the code in the Form's OnCurrent event, I'd enter
Call txtFergusonChargeback_AfterUpdate()? -- GD "Jeff Boyce" wrote: When your form loads up a record, you want the AfterUpdate event on that control to fire, right? So you could add something like the following to the Form's OnCurrent event: Call txtFergusonChargeback_AfterUpdate() (by the way, if you've named that control to reflect the underlying field, it would appear you have data -- "Ferguson" -- embedded in your field name. This is not a good idea in a well-normalized relational database.) Good luck! Regards Jeff Boyce Microsoft Office/Access MVP "GD" wrote in message ... I have a form that uses the AfterUpdate event procedure to make several areas visible or invisible. Example: Private Sub txtFergusonChargeback__AfterUpdate() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub Private Sub Form_Current() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub However, this is not exactly what I'm looking for. Basically, I need for the date to appear if there is any entry in txtFergusonChargeback_, not just after it's updated. What event do I use for that? -- GD |
#4
|
|||
|
|||
Alternative to AfterUpdate?
Given he's already got the same code in the Current event, I'm suspecting
there may be something else going on here, Jeff. I do agree with you, though, that he should be calling the AfterUpdate routine from the Currnet event so as not to have duplicated code. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jeff Boyce" wrote in message ... When your form loads up a record, you want the AfterUpdate event on that control to fire, right? So you could add something like the following to the Form's OnCurrent event: Call txtFergusonChargeback_AfterUpdate() (by the way, if you've named that control to reflect the underlying field, it would appear you have data -- "Ferguson" -- embedded in your field name. This is not a good idea in a well-normalized relational database.) Good luck! Regards Jeff Boyce Microsoft Office/Access MVP "GD" wrote in message ... I have a form that uses the AfterUpdate event procedure to make several areas visible or invisible. Example: Private Sub txtFergusonChargeback__AfterUpdate() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub Private Sub Form_Current() If Me.txtFergusonChargeback_ "" Then Me.txtEntryDate = Date Else Me.txtEntryDate = "" End If End Sub However, this is not exactly what I'm looking for. Basically, I need for the date to appear if there is any entry in txtFergusonChargeback_, not just after it's updated. What event do I use for that? -- GD |
#5
|
|||
|
|||
Alternative to AfterUpdate?
=?Utf-8?B?R0Q=?= wrote in
: So, instead of repeating the code in the Form's OnCurrent event, I'd enter Call txtFergusonChargeback_AfterUpdate()? You could do that, but I'd suggest taking the code in txtFergusonChargeback_AfterUpdate and moving it to a standalone subroutine in the form's module and calling that subroutine from both txtFergusonChargeback_AfterUpdate and OnCurrent. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |
Thread Tools | |
Display Modes | |
|
|