Text Box error (1 Viewer)

StaceyS

New member
Local time
Today, 00:32
Joined
Feb 19, 2003
Messages
5
I do not use Access on daily basis but I was hoping someone could help.
We have a problem with an access program. I know this may be hard to figure this out without seeing the whole process. This is what is happening. A user is entering data on a form. She will enter a qty in one of three text boxes.
When the text box looses focus it is will calculate the total price
including shipping from tables within the database. As soon as you leave the qty text box an error occurs and it will send you to the code. Here is the code it goes to.

generic is the name of the form they are entering data on

Sub UpdateFields(m_field)

' this sets the val for a qty to null if <= 0

IF Not IsNull(Forms! [generic] (m_field)) Then
If Not Forms! [generic] (m_field) > 0 Then
Forms! [generic] (m_field) = Null
End If
End If

S Forms! [generic] . Recalc

The word Recalc is highlighted in yellow. Is something missing. Could they
have been entering so fast when it went to this screen they erased
something. Thought the S infront of forms was wrong or is Recalc a valid
word?

Just tried to run the program again and got this error. All the data in the
files look good. This program was working fine until one record. She said
she wasn't looking sometimes what she was typing.

This is the second place it takes you after showing the first error.
It says Run Time Error 57097.


> Function CalcProdGrandtotal() As Currency
>
> m_grandtot = 0
>
> For i = 1 To 5
> fldname = "prod" & Trim(Str$(i)) & "val"
> '' calcname = "tax" & Trim(Str$(i)) & "val"
>
> 'MsgBox calcname & " " & forms![generic](calcname)
>
> If (Forms![generic](fldname) > 0) Then
> ' there is something there
>
> calcname = "subtot" & Trim(Str$(i)) & "val"
> m_grandtot = m_grandtot + Forms![generic](calcname)
>
> calcname = "tax" & Trim(Str$(i)) & "val"
> m_grandtot = m_grandtot + Forms![generic](calcname)
>
> calcname = "ship" & Trim(Str$(i)) & "val"
> m_grandtot = m_grandtot + Forms![generic](calcname)
>
> End If
>
>
> Next i
>
> CalcProdGrandtotal = m_grandtot
>
> End Function
>

Thanks in advance for your help
 
Last edited:

bjackson

Registered User.
Local time
Today, 14:32
Joined
Jan 3, 2003
Messages
404
S Forms! [generic] . Recalc , get rid of the s

Forms! [generic] . Recalc
also if the application is such that you can access any code
module you should compile and save it,as this may also
highlight any other syntax problems you may have
 

StaceyS

New member
Local time
Today, 00:32
Joined
Feb 19, 2003
Messages
5
Thank you

Thank you very much. Problem is solved. Stacey
 

Users who are viewing this thread

Top Bottom