G
Guest
Good day,
I am trying to write code to get a sub form table to recogninze the main
table and performe a calculation based on a field. I am using lost focus
Baically My input table (Input_Tbl) is the table I use for inputing standard
information for a record. I have then created another table for my subform
(Output_Tbl) which the related to the Input tbl by the ID (One to Many).
what I want to do is when a field say for example Machine type (MACTYPE) =
1034 in my sub_tbl in another field in the sub_tbl (example PCSHR) to
calculate and return a value based on using a field in the Input_tbl. The
code I write is
Private Sub MACTYPE_LostFocus()
If MACTYPE = "1034" Then
PCSHR = input_tbl.[Length] * 2
Else
PCSHR = 0
End If
End Sub
And it does not work. Please Help. Thanks Kyle.
I am trying to write code to get a sub form table to recogninze the main
table and performe a calculation based on a field. I am using lost focus
Baically My input table (Input_Tbl) is the table I use for inputing standard
information for a record. I have then created another table for my subform
(Output_Tbl) which the related to the Input tbl by the ID (One to Many).
what I want to do is when a field say for example Machine type (MACTYPE) =
1034 in my sub_tbl in another field in the sub_tbl (example PCSHR) to
calculate and return a value based on using a field in the Input_tbl. The
code I write is
Private Sub MACTYPE_LostFocus()
If MACTYPE = "1034" Then
PCSHR = input_tbl.[Length] * 2
Else
PCSHR = 0
End If
End Sub
And it does not work. Please Help. Thanks Kyle.