Hi, So i have a table that links to a form. When someone is using this form they are going to put in values for eight fields, the fields are c800, c1000, c1200 and so on until c2200. The numbers they input need to be used to interpolate numbers for the fields between them so c850, c900, c950 and so on. I wrote a code that I am trying to link to a button on the form but I cannot make it do anything or even except the numbers that are typed into the fields or display the calculated values into the corresponding fields. The code is copied below. Its only part of it since the entire thing just repeats itself.
Private Sub Command315_Click()
On Error GoTo Command315_Click_Err
DoCmd.RunMacro "Non expendable inter", , ""
If [c800] = "" Then
[c850] = "N/A"
[c900] = "N/A"
[c950] = "N/A"
ElseIf [c800] < [c1000] Then
[c850] = ([c800] + (([c1000] - [c800]) / 4))
[c900] = ([c800] + (([c1000] - [c800]) / 2))
[c950] = ([c800] + (([c1000] - [c800]) / (3 / 4)))
ElseIf [c800] > [c1000] Then
[c850] = ([c1000] + (([c800] - [c1000]) / 4))
[c900] = ([c1000] + (([c800] - [c1000]) / 2))
[c950] = ([c1000] + (([c800] - [c1000]) / (3 / 4)))
End If
End Sub
Private Sub Command315_Click()
On Error GoTo Command315_Click_Err
DoCmd.RunMacro "Non expendable inter", , ""
If [c800] = "" Then
[c850] = "N/A"
[c900] = "N/A"
[c950] = "N/A"
ElseIf [c800] < [c1000] Then
[c850] = ([c800] + (([c1000] - [c800]) / 4))
[c900] = ([c800] + (([c1000] - [c800]) / 2))
[c950] = ([c800] + (([c1000] - [c800]) / (3 / 4)))
ElseIf [c800] > [c1000] Then
[c850] = ([c1000] + (([c800] - [c1000]) / 4))
[c900] = ([c1000] + (([c800] - [c1000]) / 2))
[c950] = ([c1000] + (([c800] - [c1000]) / (3 / 4)))
End If
End Sub