Access Access 2007 HELP Trying to Interpolate data

Joined
May 26, 2011
Messages
4
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top