JB said:
Hi
It is an MDB. I've debugged it in the 2 versions (2000/2003). In
version 2003, access gives me the next record, while 2000 stays at
the old record till the end of form_current(). When I insert a button
with a messagebox with the record_id, the program shows me the next
id (and therefore the right record) in both versions. This is after
the form_current... So my conclusion was that Access 2K only moved to
the next/previous record after the form_current() function, while
Access 2003 moved to the next/previous record before form_current().
below you'll find my code, although I doubt that you'll find the
solution with this code. If you like, I can send you my database.
(contact me at: sm_garbage @ hotmail.com)
greetings
Private Sub Form_Current()
'On Error GoTo End_Form_Current:
If blnAlGezocht Then 'when the data was succesfully retrieved
'ik gebruik het veld ID_Pleegouders om te bepalen of een record
al bestaat If (IsNull(Me.Recordset(20))) Or (Me.Recordset(20)
= "") Or (Me.Recordset(20) = 0) Then
'not from table=>calculate the fields
'Als dit record nog niet bezocht is geweest
BerekenGegevens_VulVelden
blnUitDB = False
Else
'take fields from table
'als er al een record bestaat
VulVeldenUitDB
blnUitDB = True
End If
'als goedgekeurd, niets meer wijzigen
If selGoedgekeurd Then
EnDisableFields (False)
Else
EnDisableFields (True)
End If
'als betalingsdatum is ingevuld:
'ook goedgekeurd niet meer wijzigen
'alittle test to change the fields or not
If ((Me.Recordset(42) = "") Or (IsNull(Me.Recordset(42))))
Then 'veld betalingsdatum is niet ingevuld dus men kan
nog wijzigen selGoedgekeurd.Enabled = True
Else 'kan niet meer aan/uitgeklikt worden
selGoedgekeurd.Enabled = False
End If
'als de laatste uitbetaling in dezelfde maand valt:
'ander kleurke en msgbox-ke
'give a color to the fields
If (IsNull(Me.Recordset(6))) Then
KleurVelden (KLEUR_NORMAAL)
Else
If (CInt(txtMaand.Value) = CInt(Month(Me.Recordset(6))))
And _ (CInt(txtJaar.Value) =
CInt(Month(Me.Recordset(6)))) Then
KleurVelden (KLEUR_OPVALLEND)
Else
KleurVelden (KLEUR_NORMAAL)
End If
End If
Else
EnDisableFields (False)
End If
blnGewijzigd = False
btnSlaOp.Enabled = False
Exit Sub
End_Form_Current:
' MsgBox Err & " " & Error$
End Sub
I see that you are getting values from the fields in Me.Recordset. This
is a known difference between the two versions. The form's Recordset is
late in repositioning. Instead of referring to fields in the recordset,
I'd suggest you refer, by name, to members of the form's Controls
collection instead, or else refer to them, again by name, as properties
of the form:
Me!FieldName
or
Me.FieldName
or
Me.Controls("FieldName")
Your use of numeric indexing into the form's recordset's Field
collection is fairly unusual, and I wouldn't normally recommend it in
any case. It's more reliable to use the names as string indexes into
the Controls or Properties collections. If you really must use the
numeric indexing, then I think you'll have to do a little dance with the
form's RecordsetClone:
With Me.RecordsetClone
.Bookmark = Me.Bookmark
If (IsNull(.Fields(20))) Or (.Fields(20) = "") Or (.Fields(20) =
0) Then
' ...
End If
' ...
End With