G
Guest
I have this code on a button that when pressed copies the data from the field
'run_waypoint' (based on a combo box) from each record on the source form to
a set of sequential fields [GetRound_#] on the target form. All works ok,
except that the code always goes one extra step and copies the "," comma from
the last field string. It's as if the last source record isn't really what it
seems...
I have tried using these two code snippets to register either the end of
records or the last empty field, but neither method seems to stop this
happening?, can someone help me solve this problem? What am I doing wrong?
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
If Me.CurrentRecord < Me.Recordset.RecordCount Then DoCmd.GoToRecord , ,
acNext
End If
MY CODE
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_1] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_2] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_3] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_4] =
Me.Run_waypoint & ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_5] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
'run_waypoint' (based on a combo box) from each record on the source form to
a set of sequential fields [GetRound_#] on the target form. All works ok,
except that the code always goes one extra step and copies the "," comma from
the last field string. It's as if the last source record isn't really what it
seems...
I have tried using these two code snippets to register either the end of
records or the last empty field, but neither method seems to stop this
happening?, can someone help me solve this problem? What am I doing wrong?
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
If Me.CurrentRecord < Me.Recordset.RecordCount Then DoCmd.GoToRecord , ,
acNext
End If
MY CODE
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_1] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_2] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_3] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_4] =
Me.Run_waypoint & ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If
Forms.frm_Runs.[frm_Getround_MapMaker].Form.[GetRound_5] = Me.Run_waypoint
& ", " & Me.Postcode
If Me.Recordset.EOF = True Then
MsgBox "cannot go to next record"
Else
DoCmd.GoToRecord , , acNext
End If