making a form field remember

S

sushi155

Hello. I am having a weird problem. I am trying to have 4 fields sta
the same as I have much data to be entered that will have these
things in common. This is the code i'm using:

Forms!frmInputTreatyInfo!Company.DefaultValue
Forms!frmInputTreatyInfo!Company.Value

Each of the 4 fields has a different sub before update function wit
this line of code within the form but for some reason only two of the
work. All four lines are exactly the same but with the field's nam
inserted appropriately. Any help
 
M

Marshall Barton

sushi155 said:
Hello. I am having a weird problem. I am trying to have 4 fields stay
the same as I have much data to be entered that will have these 4
things in common. This is the code i'm using:

Forms!frmInputTreatyInfo!Company.DefaultValue =
Forms!frmInputTreatyInfo!Company.Value

Each of the 4 fields has a different sub before update function with
this line of code within the form but for some reason only two of them
work. All four lines are exactly the same but with the field's name
inserted appropriately. Any help?


You should use the control's AfterUpdate event procedure for
this.

The line of code you posted will work fine for numeric
values, but it will not work for date or text values.

To be safe for all types of values, you should use:

Company.DefaultValue = """" & Company.DefaultValue & """"
 
Top