Save data generated in form to table

  • Thread starter Thread starter William Storey II
  • Start date Start date
W

William Storey II

Hello i have two quick questions,

1.)I have a form (frm_sales) there are a couple of fields that the info is
generated by formulas on the form and i was wondering how do i save this
info to the table

2.) i have a field called split what i need to do is set it up so that when
split(which is boolean) is true that the fields sub,tax,total, and matt pad
are cut in half i tried a iif formula but then it would not allow me to
enter any info in the fields of sub or tax or total

if you need more info on the database in order to help me more accurately
please feel free to email me at (e-mail address removed)

thanks for the help
 
William Storey II said:
1.)I have a form (frm_sales) there are a couple of fields that the info is
generated by formulas on the form and i was wondering how do i save this
info to the table

2.) i have a field called split what i need to do is set it up so that when
split(which is boolean) is true that the fields sub,tax,total, and matt pad
are cut in half i tried a iif formula but then it would not allow me to
enter any info in the fields of sub or tax or total

William,

to 1)
Create for each needed field a bound invisible text box on the form
and assign the calculated values in the form's BeforeUpdate event:

Me![MyBoundField] = Me![MyCorrespondingFieldWithFormula]

to 2)
A similar solution. You'd need something like this in the AfterUpdate
event of the split control:

With Me
If ![split] Then
If Not IsNull( ![sub]) Then ![sub] = ![sub] / 2
If Not IsNull( ![tax]) Then ![tax] = ![tax] / 2
'... similar for all other fields to be halved
End If
End With

And something else: Split is a built in function in A2K (and probably
higher versions), so it is a very bad idea to name a field or control
or whatever such. related to this, you may want to think about a
naming convention soem time.

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top