A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Alternative to AfterUpdate?



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2009, 06:46 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default 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  
Old January 14th, 2009, 07:36 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default 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  
Old January 14th, 2009, 07:53 PM posted to microsoft.public.access.gettingstarted
gd
external usenet poster
 
Posts: 209
Default 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  
Old January 14th, 2009, 07:56 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default 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  
Old January 15th, 2009, 08:06 PM posted to microsoft.public.access.gettingstarted
David W. Fenton
external usenet poster
 
Posts: 3,373
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.