moving around a subform

rbinder

rbinder
Local time
Tomorrow, 03:40
Joined
Aug 13, 2005
Messages
25
Greetings,

I have a subform where I can edit data and I have the following code;


Public Sub GotoNewRecord()

If Me.sumtransvolume = me.TotalLitres Then
Me.LabOpNumber.SetFocus
Else
DoCmd.GoToRecord , , acNext
End If

what occurs is that focus moves to a new record not the next record.

I am puzzles by this? Any clues how to fix this and get the control moving to the next record (some subform has 10-15 records)


rbinder
 
Greetings,

I have also tried this - it gives the same result

rbinder
 
Code:
If Me.sumtransvolume = me.TotalLitres
is the condition that triggers the changing of focus.

What happens is, I think, that this condition is never met. Since this is the case, your program always goes to the next record on your form until it reaches a blank record. In that record, the condition is met (since both values are Null).

Re-evalute your condition and see if it's correct. Maybe you mean that if those values are the same, the form needs to go to the next record? Or am I getting it wrong? If this is the case, please explain us what you want the code to do exacty.

Greetings,

Seth
 

Users who are viewing this thread

Back
Top Bottom