i have problem with calculate textbox

Dlovan-IT

Registered User.
Local time
Today, 02:02
Joined
Oct 9, 2013
Messages
84
hello every body

i have a database for the fast food and i have the form called frmSell , when the user order the food goes to the list but when he doesn't want double click on the link it was deleted but i have problem with the price cause it calculate all the price of other table it will be depended on the table number , please check my database on the attachment
 

Attachments

I'm probably going to need a better explanation. I tried to look through your code, but it is not properly tabbed and I can't give you the time to analyze it further without knowing where the problem is.

try providing some code snippits in
Code:
 braces, Thanks.
 
thanks @BlueIshDan , i solved my problem by changing some code i have problem with the loop , but another thing i don't no why some time when run the form this thing was happened i don't no why it was happened and how to fix ?

look my attachment

regards
 

Attachments

  • 09-6-2014 3-22-38 PM.jpg
    09-6-2014 3-22-38 PM.jpg
    57.6 KB · Views: 112
:) no i'm not talking about the loop i fixed but look my interface fucked up :( i don't no what is problem i will be go to design view and opening again form view ten times i will be do it , you know what is the problem ?
 
You loop won't stop looping and it's stopping your form from loading because the loop is in the onLoad event.
 
this is my code running on the load

Code:
If Not IsNull(OpenArgs) Then
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("table1")
    Text9.Value = OpenArgs
    List11.RowSource = "select * from table1 where tableno=" + "'" + Text9 + "'"
s = 0
While rs.EOF = False
If rs!tableno = Text9 Then
s = s + rs!price
Else
End If
rs.Move 1
Wend
Text13 = s
End If

DoCmd.Maximize
 
When learning to code, I found that tabbing my code gave me a better sense of scope in my code. In return this helped my brain handle more complex code with pushing the point of "brain scrambling" complexity lol. I think any programmer will know what I am talking about... I hope haha

Code:
    ' Try to use tab please :)
    If Not IsNull(OpenArgs) Then
    
        Dim rs As Recordset
        Set rs = CurrentDb.OpenRecordset("table1")
        
        Text9.Value = OpenArgs
        List11.RowSource = "select * from table1 where tableno=""" & Text9 & """"

        s = 0

        While rs.EOF = False
        
            If rs!tableno = Text9 Then
                s = s + rs!price
            Else
                'Where is your else code?
            End If
            
            'Changed to MoveNext
            rs.MoveNext
            
        Wend
        
        Text13 = s
        
    End If
    
    DoCmd.Maximize
 
Last edited:
hhhh i know @scrambling , u are right i trying too much every day , but this code that you put it for me it was not worked i have the same problem , alse fo this section

'where is else code'

the else code is not doing any thing like computer he is not doing any thing without my permission :D
 
Do you know how to breakpoint and step through your code?

Try breakpointing at the beginning of your onLoad event.
(To breakpoint, click on the left column of your code window.)

After your breakpoint is placed, launch your form normally.

Your program will pause at the breakpoint that you have placed.
To traverse through your code, press [SHIFT]+[F8].

(Hint: Put a breakpoint at the beginning of all, if not most, of your subs and functions.
Sometimes the problem is where you wouldn't expect it.)
 
my problem it was fixed , but in one form haved the same thing , even i don't have any code when the form was running i don't no what is problem the form name is "frmTransofrm"
 
right know the frmSell is fixed this thing was not happened again , but in the form of the frmTransform happened , please check the database again
 
I'm sorry, but if you have the same problem on one form that you fixed on another. I'm not going to be your code monkey. Live and learn my friend :)
 
xxxxxddd , ok thanks dear i have special thanks for your helping :D
 
Dlovan-IT,

This does not mean that if you were to ask specific questions, I would not answer.

I am very willing to answer specific questions, provided you give me code snippets and tell me the general area of which the error is being thrown :)
 

Users who are viewing this thread

Back
Top Bottom