G
Guest
I have a series of procedures that systematically goes through each record
and transfers the contents of one field [RunWaypoint_#] to another field on a
different form.
The problem is that I only want to transfer data for records that meet a
given criteria; which is denoted by another field in the record being either
on or off. that field is called [Notmapped], and where the field is 'ticked
on', I want the code to ignore the record and go to the next record.
The code for going through the records is stated below, and works fine as it
is; but I need some advice on where to put the 'if then else' statement that
will check for the [Notmapped] field being on or off and how to make it
'jump' to the next procedure?. I have a large number of these iterating
procedures, but if someone can show me how to do this first set, thenI can
replicate throughout.
MY CODE **********************
If [Notmapped]=-1 then ???
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_1] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat1] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_2] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat2] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_3] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat3] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext
and transfers the contents of one field [RunWaypoint_#] to another field on a
different form.
The problem is that I only want to transfer data for records that meet a
given criteria; which is denoted by another field in the record being either
on or off. that field is called [Notmapped], and where the field is 'ticked
on', I want the code to ignore the record and go to the next record.
The code for going through the records is stated below, and works fine as it
is; but I need some advice on where to put the 'if then else' statement that
will check for the [Notmapped] field being on or off and how to make it
'jump' to the next procedure?. I have a large number of these iterating
procedures, but if someone can show me how to do this first set, thenI can
replicate throughout.
MY CODE **********************
If [Notmapped]=-1 then ???
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_1] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat1] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_2] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat2] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext
Forms.frm_Runs.[frm_Google_Runmaker].Form.[RunWaypoint_3] =
Me.RunMaker_Selector & ", " & Me.Postcode
Forms.frm_Runs.[frm_Google_Runmaker].Form.[Lat3] = Me.Lat
Forms![frm_Runs].[frm_RunMaker_Selector].SetFocus
Forms![frm_Runs].[frm_RunMaker_Selector].Form.[RunMaker_Selector].SetFocus
DoCmd.GoToRecord , , acNext