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  

Update field when another field is updated



 
 
Thread Tools Display Modes
  #1  
Old February 19th, 2006, 05:24 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

I have a customer form. There is one field that is a lookup so we can denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this date
(date()) as the default value.
When I change the customer status from active to inactive I want this date
field to automatically update to the date when the status is changed.
How can I do this?
Thanks
--
Jerry Schutt
  #2  
Old February 19th, 2006, 06:04 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

In the AfterUpdate event of the Status field, put code that updates the Date
field. If I'm understanding correctly, your Status field is a combo box, so
you'd use something like:

Private Sub cboStatus_AfterUpdate()

If Me.cboStatus = "Inactive" Then
Me.txtLastUpdate = Date
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
I have a customer form. There is one field that is a lookup so we can
denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this date
(date()) as the default value.
When I change the customer status from active to inactive I want this date
field to automatically update to the date when the status is changed.
How can I do this?
Thanks
--
Jerry Schutt



  #3  
Old February 19th, 2006, 09:51 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

Dear Douglass,

I am putting in the code:

Private Sub InmateStatus_AfterUpdate()
If Me.InmateStatus = "Inactive" Then
Me.Text37 = Date
End If

End Sub

this is actually not for customers but for a prison ministry newsletter I do
for our church,that is why you see inmates used
Text37 is where the date information is stored. You are right that the
status field is a combo box, however with this code the date field (Text37)
does not update.
any more suggestions?
thanks
--
Jerry Schutt


"Douglas J. Steele" wrote:

In the AfterUpdate event of the Status field, put code that updates the Date
field. If I'm understanding correctly, your Status field is a combo box, so
you'd use something like:

Private Sub cboStatus_AfterUpdate()

If Me.cboStatus = "Inactive" Then
Me.txtLastUpdate = Date
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
I have a customer form. There is one field that is a lookup so we can
denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this date
(date()) as the default value.
When I change the customer status from active to inactive I want this date
field to automatically update to the date when the status is changed.
How can I do this?
Thanks
--
Jerry Schutt




  #4  
Old February 19th, 2006, 10:39 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

Try putting the line of code

MsgBox Me.InmateStatus

in that routine before the If statement.

It's possible that the bound field for your combo box returns something
other than Active or Inactive.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
news
Dear Douglass,

I am putting in the code:

Private Sub InmateStatus_AfterUpdate()
If Me.InmateStatus = "Inactive" Then
Me.Text37 = Date
End If

End Sub

this is actually not for customers but for a prison ministry newsletter I
do
for our church,that is why you see inmates used
Text37 is where the date information is stored. You are right that the
status field is a combo box, however with this code the date field
(Text37)
does not update.
any more suggestions?
thanks
--
Jerry Schutt


"Douglas J. Steele" wrote:

In the AfterUpdate event of the Status field, put code that updates the
Date
field. If I'm understanding correctly, your Status field is a combo box,
so
you'd use something like:

Private Sub cboStatus_AfterUpdate()

If Me.cboStatus = "Inactive" Then
Me.txtLastUpdate = Date
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
I have a customer form. There is one field that is a lookup so we can
denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this date
(date()) as the default value.
When I change the customer status from active to inactive I want this
date
field to automatically update to the date when the status is changed.
How can I do this?
Thanks
--
Jerry Schutt






  #5  
Old February 22nd, 2006, 10:00 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

Dear Doug,
I hate to keep bothering you but I still cannot get this to work. Yes, you
are correc that I have more then active and inactive in the combo box. There
is also released for inmates that are released (obviously). Only these three
choices.

When I added the code
MsgBox Me.InmateStatus
before the IF statement the date field (Text37) would not update when I
changed an inmate from Active to Inactive. What would happen is that a
message box would pop up saying, "1" (for Active) or "2" for Inactive.

Any other suggestions? I am not good with VBA so I am pretty lost.
thanks
Jerry


--
Jerry Schutt


"Douglas J. Steele" wrote:

Try putting the line of code

MsgBox Me.InmateStatus

in that routine before the If statement.

It's possible that the bound field for your combo box returns something
other than Active or Inactive.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
news
Dear Douglass,

I am putting in the code:

Private Sub InmateStatus_AfterUpdate()
If Me.InmateStatus = "Inactive" Then
Me.Text37 = Date
End If

End Sub

this is actually not for customers but for a prison ministry newsletter I
do
for our church,that is why you see inmates used
Text37 is where the date information is stored. You are right that the
status field is a combo box, however with this code the date field
(Text37)
does not update.
any more suggestions?
thanks
--
Jerry Schutt


"Douglas J. Steele" wrote:

In the AfterUpdate event of the Status field, put code that updates the
Date
field. If I'm understanding correctly, your Status field is a combo box,
so
you'd use something like:

Private Sub cboStatus_AfterUpdate()

If Me.cboStatus = "Inactive" Then
Me.txtLastUpdate = Date
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
I have a customer form. There is one field that is a lookup so we can
denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this date
(date()) as the default value.
When I change the customer status from active to inactive I want this
date
field to automatically update to the date when the status is changed.
How can I do this?
Thanks
--
Jerry Schutt






  #6  
Old February 23rd, 2006, 01:34 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Update field when another field is updated

The message box did exactly what it was supposed to: it showed that
Me.InmateStatus isn't returning the word Inactive, which is what the code
was expecting.

Sounds as though what you want is:

Private Sub InmateStatus_AfterUpdate()
If Me.InmateStatus = 2 Then
Me.Text37 = Date
End If
End Sub


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
Dear Doug,
I hate to keep bothering you but I still cannot get this to work. Yes,
you
are correc that I have more then active and inactive in the combo box.
There
is also released for inmates that are released (obviously). Only these
three
choices.

When I added the code
MsgBox Me.InmateStatus
before the IF statement the date field (Text37) would not update when I
changed an inmate from Active to Inactive. What would happen is that a
message box would pop up saying, "1" (for Active) or "2" for Inactive.

Any other suggestions? I am not good with VBA so I am pretty lost.
thanks
Jerry


--
Jerry Schutt


"Douglas J. Steele" wrote:

Try putting the line of code

MsgBox Me.InmateStatus

in that routine before the If statement.

It's possible that the bound field for your combo box returns something
other than Active or Inactive.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
news
Dear Douglass,

I am putting in the code:

Private Sub InmateStatus_AfterUpdate()
If Me.InmateStatus = "Inactive" Then
Me.Text37 = Date
End If

End Sub

this is actually not for customers but for a prison ministry newsletter
I
do
for our church,that is why you see inmates used
Text37 is where the date information is stored. You are right that the
status field is a combo box, however with this code the date field
(Text37)
does not update.
any more suggestions?
thanks
--
Jerry Schutt


"Douglas J. Steele" wrote:

In the AfterUpdate event of the Status field, put code that updates
the
Date
field. If I'm understanding correctly, your Status field is a combo
box,
so
you'd use something like:

Private Sub cboStatus_AfterUpdate()

If Me.cboStatus = "Inactive" Then
Me.txtLastUpdate = Date
End If

End Sub

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Jerry" wrote in message
...
I have a customer form. There is one field that is a lookup so we
can
denote
if the customer is active or inactive.
When a new customer is added I have a date field that records this
date
(date()) as the default value.
When I change the customer status from active to inactive I want
this
date
field to automatically update to the date when the status is
changed.
How can I do this?
Thanks
--
Jerry Schutt








 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert source texts into multiple files and update automatically robfer General Discussion 9 September 12th, 2007 10:10 PM
Update Query "Only Update if Field is blank" Amy Adams via AccessMonster.com Running & Setting Up Queries 5 March 25th, 2005 07:03 PM
How do I update a timestamp field when another field is updated Swhite951 Using Forms 1 March 15th, 2005 10:40 PM
Text Form Field Ref in Footer Won't Update on Screen StarWine General Discussion 3 December 6th, 2004 06:17 PM
field manipulation Steve Running & Setting Up Queries 2 May 28th, 2004 03:12 PM


All times are GMT +1. The time now is 09:51 PM.


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