GoToRecord

C

Csaba Bona

Gruppe1.MoveFirst
Do While Not Gruppe1.EOF

If CVar(Gruppe1.Fields
(TabellenAktionStruktur.PrimärSchlüssel.Name)) = _
Nz
(TabellenAktionStruktur.PrimärSchlüssel.Wert, 0) Then
DoCmd.GoToRecord , , acGoTo,
Gruppe1.AbsolutePosition
Exit Do
End If
Gruppe1.MoveNext
Loop

'***************************************************
The above Code searches a certain Record within an opened
form (after entering a new record). But it doesn't, if
the 'ActiveControl' is a CheckBox. Why?
 
J

JohnFol

For a text box, the default property will return the value of the field. For
a chjeck box it returns if the box is selected or not. Since you will always
get a True Or False answer, your NZ will always return the same value as it
cannot be null.




Gruppe1.MoveFirst
Do While Not Gruppe1.EOF

If CVar(Gruppe1.Fields
(TabellenAktionStruktur.PrimärSchlüssel.Name)) = _
Nz
(TabellenAktionStruktur.PrimärSchlüssel.Wert, 0) Then
DoCmd.GoToRecord , , acGoTo,
Gruppe1.AbsolutePosition
Exit Do
End If
Gruppe1.MoveNext
Loop

'***************************************************
The above Code searches a certain Record within an opened
form (after entering a new record). But it doesn't, if
the 'ActiveControl' is a CheckBox. Why?
 

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

Similar Threads

Simple Loop Recordset Question 2
Drop Down doesn't populate form 0
Do/Loop Dilemma 6
Loop inside a loop 6
Looping Through Records 3
Nested IF 7
Recordset problems 1
Running Error Checks on SubForm 1

Top