S
Simon Harris
Hi All,
I have an on change event on a text box which does the following:
If Me.GasMeterType.Value = "m²" Then
Me.GasAmount.Value = (Me.Gas_Reading - Me.Gas_Reading_Previous) *
DLookup("Gas_Per_Mtr3", "tbl_constants")
ElseIf Me.GasMeterType.Value = "ft²" Then
Me.GasAmount.Value = (Me.Gas_Reading - Me.Gas_Reading_Previous) *
DLookup("Gas_Per_Ft3", "tbl_constants")
Else
MsgBox ("Warning: No gas meter type recorded for this pitch")
End If
Trouble is, when fired, this updates the GasAmount field for all
records...not just the current record as I expected. The form is normally in
data sheet mode, although I have tried continuous form, which causes the
same problem.
Odd? Or am I not understanding something here?
Thanks,
Simon.
--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
--
I have an on change event on a text box which does the following:
If Me.GasMeterType.Value = "m²" Then
Me.GasAmount.Value = (Me.Gas_Reading - Me.Gas_Reading_Previous) *
DLookup("Gas_Per_Mtr3", "tbl_constants")
ElseIf Me.GasMeterType.Value = "ft²" Then
Me.GasAmount.Value = (Me.Gas_Reading - Me.Gas_Reading_Previous) *
DLookup("Gas_Per_Ft3", "tbl_constants")
Else
MsgBox ("Warning: No gas meter type recorded for this pitch")
End If
Trouble is, when fired, this updates the GasAmount field for all
records...not just the current record as I expected. The form is normally in
data sheet mode, although I have tried continuous form, which causes the
same problem.
Odd? Or am I not understanding something here?
Thanks,
Simon.
--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
--