Code Question..........

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.
 
I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 
Ok I did something wrong. My Check box name is "FineAssessed" and my field I
want to auto update's name is "TotalBill". I place the following code in the
after update of the "TotalBill" in the event procedure

Private Sub FineAssessed_AfterUpdate()
[FineAssessed] = Not Me![TotalBill] = 0
End Sub

I don't quite understand what you mean by placeing the same code in the
forms's current event. Thanks for your help!

fredg said:
I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 
You just need some parenthesis:

[FineAssessed] = Not (Me![TotalBill] = 0)

or maybe

me.FineAssessed.value = Not (Me.TotalBill.value = 0)

might work better in a VB sub.

Bryan


Code Agent said:
Ok I did something wrong. My Check box name is "FineAssessed" and my field I
want to auto update's name is "TotalBill". I place the following code in the
after update of the "TotalBill" in the event procedure

Private Sub FineAssessed_AfterUpdate()
[FineAssessed] = Not Me![TotalBill] = 0
End Sub

I don't quite understand what you mean by placeing the same code in the
forms's current event. Thanks for your help!

fredg said:
I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 
I still couldn't get it to work. This is the way it looks in the vb code:

Private Sub TotalBill_AfterUpdate()
[FineAssessed] = Not (Me![TotalBill] = 0)
End Sub

Do you think there is a way to write "if field[TotalBill] is > than $0.00
then field[FineAssessed]=yes? as a default value?

Thanks for your help!

Bryan in Bakersfield said:
You just need some parenthesis:

[FineAssessed] = Not (Me![TotalBill] = 0)

or maybe

me.FineAssessed.value = Not (Me.TotalBill.value = 0)

might work better in a VB sub.

Bryan


Code Agent said:
Ok I did something wrong. My Check box name is "FineAssessed" and my field I
want to auto update's name is "TotalBill". I place the following code in the
after update of the "TotalBill" in the event procedure

Private Sub FineAssessed_AfterUpdate()
[FineAssessed] = Not Me![TotalBill] = 0
End Sub

I don't quite understand what you mean by placeing the same code in the
forms's current event. Thanks for your help!

fredg said:
On Wed, 14 Mar 2007 08:28:33 -0700, Code Agent wrote:

I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 
Have you tried the
me.FineAssessed.value = Not (me.TotalBill.value = 0)
in the afterUpdate event? I always use the me. in visual basic events.

or you could put

= Not (Me![TotalBill] = 0)

as the default value for FineAssessed.


Code Agent said:
I still couldn't get it to work. This is the way it looks in the vb code:

Private Sub TotalBill_AfterUpdate()
[FineAssessed] = Not (Me![TotalBill] = 0)
End Sub

Do you think there is a way to write "if field[TotalBill] is > than $0.00
then field[FineAssessed]=yes? as a default value?

Thanks for your help!

Bryan in Bakersfield said:
You just need some parenthesis:

[FineAssessed] = Not (Me![TotalBill] = 0)

or maybe

me.FineAssessed.value = Not (Me.TotalBill.value = 0)

might work better in a VB sub.

Bryan


Code Agent said:
Ok I did something wrong. My Check box name is "FineAssessed" and my field I
want to auto update's name is "TotalBill". I place the following code in the
after update of the "TotalBill" in the event procedure

Private Sub FineAssessed_AfterUpdate()
[FineAssessed] = Not Me![TotalBill] = 0
End Sub

I don't quite understand what you mean by placeing the same code in the
forms's current event. Thanks for your help!

:

On Wed, 14 Mar 2007 08:28:33 -0700, Code Agent wrote:

I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 
Whoops! Actually, for the default value it would just be

= Not ([TotalBill] = 0)


Bryan in Bakersfield said:
Have you tried the
me.FineAssessed.value = Not (me.TotalBill.value = 0)
in the afterUpdate event? I always use the me. in visual basic events.

or you could put

= Not (Me![TotalBill] = 0)

as the default value for FineAssessed.


Code Agent said:
I still couldn't get it to work. This is the way it looks in the vb code:

Private Sub TotalBill_AfterUpdate()
[FineAssessed] = Not (Me![TotalBill] = 0)
End Sub

Do you think there is a way to write "if field[TotalBill] is > than $0.00
then field[FineAssessed]=yes? as a default value?

Thanks for your help!

Bryan in Bakersfield said:
You just need some parenthesis:

[FineAssessed] = Not (Me![TotalBill] = 0)

or maybe

me.FineAssessed.value = Not (Me.TotalBill.value = 0)

might work better in a VB sub.

Bryan


:

Ok I did something wrong. My Check box name is "FineAssessed" and my field I
want to auto update's name is "TotalBill". I place the following code in the
after update of the "TotalBill" in the event procedure

Private Sub FineAssessed_AfterUpdate()
[FineAssessed] = Not Me![TotalBill] = 0
End Sub

I don't quite understand what you mean by placeing the same code in the
forms's current event. Thanks for your help!

:

On Wed, 14 Mar 2007 08:28:33 -0700, Code Agent wrote:

I have a field with the yes/no fomat. I would like an automatic "check mark"
be placed in that field if another field has the value of anything other than
$0.00. Any help would be greatly appreciated.

Code the other control's AfterUpdate event:
[CheckBox] = Not Me![OtherField] = 0

Place the same code in the Form's Current event.
 

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

Back
Top