Peter Bellamy
Registered User.
- Local time
- Today, 22:37
- Joined
- Dec 3, 2005
- Messages
- 295
I have the following in the Current Event of a form to determine some details on the form but it seem to slow down the form so much that there is a noticable delay in moving from one to the next.
records = (DCount("[goods_no]", "Goods", "[goods_returnno]=Form.[return_no]"))
Me.NoOfItems = records
test = 0
number = Nz(DSum("[goods_qnty]", "Mal Recs for Return")) ' DSum of query finding MAL records for this return
If number >= 1 Then GoTo formchoice
second:
test = 1
number1 = Nz(DSum("[goods_qnty]", "AV Recs for Return")) ' DSum of query finding AV records for this return
Can anyone suggest some code that would speed this up ?
Would writing the lines in SQL be faster? If so, I am not sure I know how to asign a variable to say a SELECT Count or SELECT Sum string.
Thanks
records = (DCount("[goods_no]", "Goods", "[goods_returnno]=Form.[return_no]"))
Me.NoOfItems = records
test = 0
number = Nz(DSum("[goods_qnty]", "Mal Recs for Return")) ' DSum of query finding MAL records for this return
If number >= 1 Then GoTo formchoice
second:
test = 1
number1 = Nz(DSum("[goods_qnty]", "AV Recs for Return")) ' DSum of query finding AV records for this return
Can anyone suggest some code that would speed this up ?
Would writing the lines in SQL be faster? If so, I am not sure I know how to asign a variable to say a SELECT Count or SELECT Sum string.
Thanks