Forcing the Current Date into a Form Field when a Checkbox is Clic

S

SkyGuy

Hello,

I'm new to Access and not familiar with Events, Procedures or Visual Basic.

I have a form with a Date Field called "Expiration Date". In the same form I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration Date when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
E

Ed Robichaud

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed
 
S

SkyGuy

I apologize Ed...Terminated is not a Checkbox. It's a Selection List with
either a value of Yes or No. So if I select Yes in Terminated I want the
Experiation field to be populated with today's date. Again, sorry for the
initial misinformation.
Bob

Ed Robichaud said:
In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



SkyGuy said:
Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the same form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
E

Ed Robichaud

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List with
either a value of Yes or No. So if I select Yes in Terminated I want the
Experiation field to be populated with today's date. Again, sorry for the
initial misinformation.
Bob

Ed Robichaud said:
In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



SkyGuy said:
Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Ok Ed...I right-clicked on the form's Terminated field in Design View then
choice Build Event. I then chose "After Update" from the drop-down list in
Visual Basic. But when I do a save Visual Basic eliminates the () after =Date
and the solution does not work. What am I doing wrong...thanks.

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List with
either a value of Yes or No. So if I select Yes in Terminated I want the
Experiation field to be populated with today's date. Again, sorry for the
initial misinformation.
Bob

Ed Robichaud said:
In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

So after I paste the code below in the VB windows and save the parenthesis
after the =Date() disappear. And the Experation Date does not populate
w/Today's Date when the Termintated Selection List is changed to "Yes".

Any suggestions?

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List with
either a value of Yes or No. So if I select Yes in Terminated I want the
Experiation field to be populated with today's date. Again, sorry for the
initial misinformation.
Bob

Ed Robichaud said:
In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

My 2 cents worth...

You said you went to ' form's Terminated field in Design View then ' (you
just want to make sure it's not on the After Update of the form because it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina
message Ok Ed...I right-clicked on the form's Terminated field in Design View then
choice Build Event. I then chose "After Update" from the drop-down list in
Visual Basic. But when I do a save Visual Basic eliminates the () after
=Date
and the solution does not work. What am I doing wrong...thanks.

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Gina,

I replied to your post but it looks like it didn't take. So here's another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the drop-down
arrow. There was only one choice; [Event Procedure]. I selected this then
clicked on the elipses button to the right. A windows opened and I pasted my
code just below the "Private Sub Terminated_AfterUpdate()" and did a save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


Gina Whipp said:
My 2 cents worth...

You said you went to ' form's Terminated field in Design View then ' (you
just want to make sure it's not on the After Update of the form because it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina
message Ok Ed...I right-clicked on the form's Terminated field in Design View then
choice Build Event. I then chose "After Update" from the drop-down list in
Visual Basic. But when I do a save Visual Basic eliminates the () after
=Date
and the solution does not work. What am I doing wrong...thanks.

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

You Expiry Date, is it a combo box and is it just 1 column?

SkyGuy said:
Gina,

I replied to your post but it looks like it didn't take. So here's another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this then
clicked on the elipses button to the right. A windows opened and I pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


Gina Whipp said:
My 2 cents worth...

You said you went to ' form's Terminated field in Design View then '
(you
just want to make sure it's not on the After Update of the form because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina
message Ok Ed...I right-clicked on the form's Terminated field in Design View
then
choice Build Event. I then chose "After Update" from the drop-down list
in
Visual Basic. But when I do a save Visual Basic eliminates the () after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or
Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

Please try pasting the below code and then change the combo box. Does a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


SkyGuy said:
Gina,

I replied to your post but it looks like it didn't take. So here's another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this then
clicked on the elipses button to the right. A windows opened and I pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


Gina Whipp said:
My 2 cents worth...

You said you went to ' form's Terminated field in Design View then '
(you
just want to make sure it's not on the After Update of the form because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina
message Ok Ed...I right-clicked on the form's Terminated field in Design View
then
choice Build Event. I then chose "After Update" from the drop-down list
in
Visual Basic. But when I do a save Visual Basic eliminates the () after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or
Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool. But
obviously I still have a problem.

Bob

Gina Whipp said:
Please try pasting the below code and then change the combo box. Does a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


SkyGuy said:
Gina,

I replied to your post but it looks like it didn't take. So here's another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this then
clicked on the elipses button to the right. A windows opened and I pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


Gina Whipp said:
My 2 cents worth...

You said you went to ' form's Terminated field in Design View then '
(you
just want to make sure it's not on the After Update of the form because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina

message Ok Ed...I right-clicked on the form's Terminated field in Design View
then
choice Build Event. I then chose "After Update" from the drop-down list
in
Visual Basic. But when I do a save Visual Basic eliminates the () after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or
Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

Okay but at least we now know the code is being read! Your combo box, is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row Source
Type = Value List.


SkyGuy said:
Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool. But
obviously I still have a problem.

Bob

Gina Whipp said:
Please try pasting the below code and then change the combo box. Does a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


SkyGuy said:
Gina,

I replied to your post but it looks like it didn't take. So here's
another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this
then
clicked on the elipses button to the right. A windows opened and I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View then '
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina

in
message Ok Ed...I right-clicked on the form's Terminated field in Design
View
then
choice Build Event. I then chose "After Update" from the drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the ()
after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection
List
with
either a value of Yes or No. So if I select Yes in Terminated I
want
the
Experiation field to be populated with today's date. Again, sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or
Visual
Basic.

I have a form with a Date Field called "Expiration Date". In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated is a
selection list w/either a value of No or Yes. So I guess the correct answer
to your first question is 2 rows.

Gina Whipp said:
Okay but at least we now know the code is being read! Your combo box, is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row Source
Type = Value List.


SkyGuy said:
Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool. But
obviously I still have a problem.

Bob

Gina Whipp said:
Please try pasting the below code and then change the combo box. Does a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So here's
another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this
then
clicked on the elipses button to the right. A windows opened and I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View then '
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click if
Properties Window for your field is not showing and select Properties.
3. In the Properties Window for your field scroll down till you find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht it's
suppose to.

Gina

in
message Ok Ed...I right-clicked on the form's Terminated field in Design
View
then
choice Build Event. I then chose "After Update" from the drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the ()
after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection
List
with
either a value of Yes or No. So if I select Yes in Terminated I
want
the
Experiation field to be populated with today's date. Again, sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or
Visual
Basic.

I have a form with a Date Field called "Expiration Date". In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

Selection LIst? You mean it's NOT a combo box? Combo Box has a little
arrow where you select from a list.


SkyGuy said:
Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated is a
selection list w/either a value of No or Yes. So I guess the correct
answer
to your first question is 2 rows.

Gina Whipp said:
Okay but at least we now know the code is being read! Your combo box, is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row
Source
Type = Value List.


SkyGuy said:
Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool. But
obviously I still have a problem.

Bob

:

Please try pasting the below code and then change the combo box. Does
a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So here's
another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this
then
clicked on the elipses button to the right. A windows opened and I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View then
'
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click
if
Properties Window for your field is not showing and select
Properties.
3. In the Properties Window for your field scroll down till you
find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht
it's
suppose to.

Gina

choice Build Event"SkyGuy" <[email protected]>
wrote
in
message
Ok Ed...I right-clicked on the form's Terminated field in Design
View
then
choice Build Event. I then chose "After Update" from the
drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the ()
after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection
List
with
either a value of Yes or No. So if I select Yes in Terminated
I
want
the
Experiation field to be populated with today's date. Again,
sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures
or
Visual
Basic.

I have a form with a Date Field called "Expiration Date".
In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Yes Gina, the Terminated form field has a little arrow to select from a list.
So it is a combo box. Sorry for the mix up in terminology...I'm new to this.

Bob

Gina Whipp said:
Selection LIst? You mean it's NOT a combo box? Combo Box has a little
arrow where you select from a list.


SkyGuy said:
Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated is a
selection list w/either a value of No or Yes. So I guess the correct
answer
to your first question is 2 rows.

Gina Whipp said:
Okay but at least we now know the code is being read! Your combo box, is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row
Source
Type = Value List.


Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool. But
obviously I still have a problem.

Bob

:

Please try pasting the below code and then change the combo box. Does
a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So here's
another
post.
First of all...thanks for your help...but my Date field is still not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected this
then
clicked on the elipses button to the right. A windows opened and I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View then
'
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse click
if
Properties Window for your field is not showing and select
Properties.
3. In the Properties Window for your field scroll down till you
find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht
it's
suppose to.

Gina

choice Build Event"SkyGuy" <[email protected]>
wrote
in
message
Ok Ed...I right-clicked on the form's Terminated field in Design
View
then
choice Build Event. I then chose "After Update" from the
drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the ()
after
=Date
and the solution does not work. What am I doing wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a Selection
List
with
either a value of Yes or No. So if I select Yes in Terminated
I
want
the
Experiation field to be populated with today's date. Again,
sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures
or
Visual
Basic.

I have a form with a Date Field called "Expiration Date".
In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
J

John Spencer

Pardon me, but I think that the Row source being Yes; No might end up being
True/False when you are testing the value.

Using your earlier test technique

Msgbox "The value is " & me.terminated

IF the message comes back
The value is -1 or The value is 0 then you probably are returning true and
false.

If the message is
The value is <blank> then you know that somehow your combobox is not
retaining the value.

SkyGuy said:
Yes Gina, the Terminated form field has a little arrow to select from a
list.
So it is a combo box. Sorry for the mix up in terminology...I'm new to
this.

Bob

Gina Whipp said:
Selection LIst? You mean it's NOT a combo box? Combo Box has a little
arrow where you select from a list.


SkyGuy said:
Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated is
a
selection list w/either a value of No or Yes. So I guess the correct
answer
to your first question is 2 rows.

:

Okay but at least we now know the code is being read! Your combo box,
is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see
is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row
Source
Type = Value List.


Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool.
But
obviously I still have a problem.

Bob

:

Please try pasting the below code and then change the combo box.
Does
a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So
here's
another
post.
First of all...thanks for your help...but my Date field is still
not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected
this
then
clicked on the elipses button to the right. A windows opened and
I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and
did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View
then
'
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse
click
if
Properties Window for your field is not showing and select
Properties.
3. In the Properties Window for your field scroll down till you
find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not
work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht
it's
suppose to.

Gina

choice Build Event"SkyGuy" <[email protected]>
wrote
in
message
Ok Ed...I right-clicked on the form's Terminated field in
Design
View
then
choice Build Event. I then chose "After Update" from the
drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the
()
after
=Date
and the solution does not work. What am I doing
wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a
Selection
List
with
either a value of Yes or No. So if I select Yes in
Terminated
I
want
the
Experiation field to be populated with today's date. Again,
sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



message
Hello,

I'm new to Access and not familiar with Events,
Procedures
or
Visual
Basic.

I have a form with a Date Field called "Expiration
Date".
In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

Do you try what John suggested, he has a point!

SkyGuy said:
So after I paste the code below in the VB windows and save the parenthesis
after the =Date() disappear. And the Experation Date does not populate
w/Today's Date when the Termintated Selection List is changed to "Yes".

Any suggestions?

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

And check the time on your PC seems to be acting a little weird, says you
posted this message at 8:25am???

SkyGuy said:
So after I paste the code below in the VB windows and save the parenthesis
after the =Date() disappear. And the Experation Date does not populate
w/Today's Date when the Termintated Selection List is changed to "Yes".

Any suggestions?

Ed Robichaud said:
OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


SkyGuy said:
I apologize Ed...Terminated is not a Checkbox. It's a Selection List
with
either a value of Yes or No. So if I select Yes in Terminated I want
the
Experiation field to be populated with today's date. Again, sorry for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



Hello,

I'm new to Access and not familiar with Events, Procedures or Visual
Basic.

I have a form with a Date Field called "Expiration Date". In the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
S

SkyGuy

Ok...here's my current code, which is working (somewhat). I change Terminated
from "No" to "Yes" and Expiry Date remains blank. But after after I move to
the next/previous record, then go back to the record that I set Terminated to
"Yes", the Expiry Date will display the current date.

Private Sub Terminated_Change()
If Me.Terminated = "-1" Then
Me![Expiry Date].Value = Now()
MsgBox "Yes, I work!", vbOKOnly, "Test"
Else
MsgBox "No, I don't work!", vbOKOnly, "Test"
End If

End Sub

John Spencer said:
Pardon me, but I think that the Row source being Yes; No might end up being
True/False when you are testing the value.

Using your earlier test technique

Msgbox "The value is " & me.terminated

IF the message comes back
The value is -1 or The value is 0 then you probably are returning true and
false.

If the message is
The value is <blank> then you know that somehow your combobox is not
retaining the value.

SkyGuy said:
Yes Gina, the Terminated form field has a little arrow to select from a
list.
So it is a combo box. Sorry for the mix up in terminology...I'm new to
this.

Bob

Gina Whipp said:
Selection LIst? You mean it's NOT a combo box? Combo Box has a little
arrow where you select from a list.


Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated is
a
selection list w/either a value of No or Yes. So I guess the correct
answer
to your first question is 2 rows.

:

Okay but at least we now know the code is being read! Your combo box,
is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should see
is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and Row
Source
Type = Value List.


Gina,

A pop-up msg appeared that said "No, I don't work!". That was cool.
But
obviously I still have a problem.

Bob

:

Please try pasting the below code and then change the combo box.
Does
a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So
here's
another
post.
First of all...thanks for your help...but my Date field is still
not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field, selected
Properties, then scrolled down to After Update and clicked on the
drop-down
arrow. There was only one choice; [Event Procedure]. I selected
this
then
clicked on the elipses button to the right. A windows opened and
I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and
did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View
then
'
(you
just want to make sure it's not on the After Update of the form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse
click
if
Properties Window for your field is not showing and select
Properties.
3. In the Properties Window for your field scroll down till you
find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not
work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does wht
it's
suppose to.

Gina

choice Build Event"SkyGuy" <[email protected]>
wrote
in
message
Ok Ed...I right-clicked on the form's Terminated field in
Design
View
then
choice Build Event. I then chose "After Update" from the
drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates the
()
after
=Date
and the solution does not work. What am I doing
wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


I apologize Ed...Terminated is not a Checkbox. It's a
Selection
List
with
either a value of Yes or No. So if I select Yes in
Terminated
I
want
the
Experiation field to be populated with today's date. Again,
sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



message
Hello,

I'm new to Access and not familiar with Events,
Procedures
or
Visual
Basic.

I have a form with a Date Field called "Expiration
Date".
In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 
G

Gina Whipp

Try putting the code on the After Update of the combo box and on the On
Current of the form.


SkyGuy said:
Ok...here's my current code, which is working (somewhat). I change
Terminated
from "No" to "Yes" and Expiry Date remains blank. But after after I move
to
the next/previous record, then go back to the record that I set Terminated
to
"Yes", the Expiry Date will display the current date.

Private Sub Terminated_Change()
If Me.Terminated = "-1" Then
Me![Expiry Date].Value = Now()
MsgBox "Yes, I work!", vbOKOnly, "Test"
Else
MsgBox "No, I don't work!", vbOKOnly, "Test"
End If

End Sub

John Spencer said:
Pardon me, but I think that the Row source being Yes; No might end up
being
True/False when you are testing the value.

Using your earlier test technique

Msgbox "The value is " & me.terminated

IF the message comes back
The value is -1 or The value is 0 then you probably are returning true
and
false.

If the message is
The value is <blank> then you know that somehow your combobox is not
retaining the value.

SkyGuy said:
Yes Gina, the Terminated form field has a little arrow to select from a
list.
So it is a combo box. Sorry for the mix up in terminology...I'm new to
this.

Bob

:

Selection LIst? You mean it's NOT a combo box? Combo Box has a
little
arrow where you select from a list.


Bound Column: 1
Column Count: 1
Row Source: Yes;No
Row Source Type: Value List

I'm not sure what you mean by combo box. But on the form, Terminated
is
a
selection list w/either a value of No or Yes. So I guess the correct
answer
to your first question is 2 rows.

:

Okay but at least we now know the code is being read! Your combo
box,
is
that a single row not 2 row

1;Yes
2;No

and the bound column is 1?

Please look at the Property Window of Terminated, what you should
see
is
Column Count = 1 and Bound Column = 1 and Row Source = Yes;No and
Row
Source
Type = Value List.


Gina,

A pop-up msg appeared that said "No, I don't work!". That was
cool.
But
obviously I still have a problem.

Bob

:

Please try pasting the below code and then change the combo box.
Does
a
message come up?

If Me.Terminated = "Yes" Then
'Me.[Expiry Date] = Date
MsgBox "Yes, I work!", vbOkOnly, "Test"
Else
MsgBox "No, I don't work!", vbOkOnly, "Test"
End If


Gina,

I replied to your post but it looks like it didn't take. So
here's
another
post.
First of all...thanks for your help...but my Date field is
still
not
populating.

I'm using MS Access 2002.

In Design View, I right-clicked on the Terminated Field,
selected
Properties, then scrolled down to After Update and clicked on
the
drop-down
arrow. There was only one choice; [Event Procedure]. I
selected
this
then
clicked on the elipses button to the right. A windows opened
and
I
pasted
my
code just below the "Private Sub Terminated_AfterUpdate()" and
did a
save.

Here's a copy of my code:

Private Sub Terminated_AfterUpdate()

If Me.[Terminated] = "Yes" Then
Me.[Expiry Date] = Date
End If


End Sub

Thanks again,
Bob


:

My 2 cents worth...

You said you went to ' form's Terminated field in Design View
then
'
(you
just want to make sure it's not on the After Update of the
form
because
it
needs to be on the After Update of the control)

Okay not sure the code is in the correct place, so just check

1. Go to Design View on the form
2. Go click on you field ' Terminated ' and then right mouse
click
if
Properties Window for your field is not showing and select
Properties.
3. In the Properties Window for your field scroll down till
you
find
the
After Update Event and select ... Build Event
4. Place your code, close and save. Try it, if that does not
work
post
back.

If you have already done the above "NEVERMIND"

The () after Date sometime disappears on mine to, still does
wht
it's
suppose to.

Gina

choice Build Event"SkyGuy"
<[email protected]>
wrote
in
message
Ok Ed...I right-clicked on the form's Terminated field in
Design
View
then
choice Build Event. I then chose "After Update" from the
drop-down
list
in
Visual Basic. But when I do a save Visual Basic eliminates
the
()
after
=Date
and the solution does not work. What am I doing
wrong...thanks.

:

OK, just change it to:

If Me.[Terminated] = "Yes" Then
Me.[Expiration Date] = Date()
End if


message
I apologize Ed...Terminated is not a Checkbox. It's a
Selection
List
with
either a value of Yes or No. So if I select Yes in
Terminated
I
want
the
Experiation field to be populated with today's date.
Again,
sorry
for
the
initial misinformation.
Bob

:

In the AfterUpdate event of your checkbox, put:

If Me.[Terminated] = -1 then
Me.[Expiration Date] = Date()
End if

-Ed



message
Hello,

I'm new to Access and not familiar with Events,
Procedures
or
Visual
Basic.

I have a form with a Date Field called "Expiration
Date".
In
the
same
form
I
have a Checkbox called "Terminated".

I'd like the current date to automatically populate
the
Expiration
Date
when
Terminated is checked.

Any help would be very much appreciated.

Thanks,
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top