Trick If, then, Else Help needed...

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
 
J

Jeff Boyce

You've described "how" you are trying to do something (iterating through a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be snoopy
.... but there's a chance that if the newsgroup readers understood better
what business value you hope to add, they might be able to offer alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Jeff,

No prob wit explaining things. I just thought it best to be brief: I am
trying to get Googlemaps make a map for me, but it can only work on real road
names, things like roundabouts and other obscure non-classified places gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my code to say:

check if this is marked not mapped, if it is, then ignore it and move to the
next field to be copied, and so on...

does this all make sense?



Jeff Boyce said:
You've described "how" you are trying to do something (iterating through a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be snoopy
.... but there's a chance that if the newsgroup readers understood better
what business value you hope to add, they might be able to offer alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
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
 
J

Jeff Boyce

That explains more where you hope to get. Now, why are you "moving" data
around? Could a query that returns data be a solution, or are you creating
a new table?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

No prob wit explaining things. I just thought it best to be brief: I am
trying to get Googlemaps make a map for me, but it can only work on real
road
names, things like roundabouts and other obscure non-classified places
gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my code to
say:

check if this is marked not mapped, if it is, then ignore it and move to
the
next field to be copied, and so on...

does this all make sense?



Jeff Boyce said:
You've described "how" you are trying to do something (iterating through
a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be
snoopy
.... but there's a chance that if the newsgroup readers understood better
what business value you hope to add, they might be able to offer
alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
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
 
G

Guest

Jeff,

The data being moved around is coming from a continous form and going to a
tabulated form with lots of fields that represent the 'waypoint' fields for
my google route. This began life as a 'Route test' form for delivery drivers.
The way it works is this:

Selector Form: (fields below are mixed in random order)

Field 1: Main St
Field 2: South St
Field 3: Long Road
Field 4: Roundabout
Field 5: Short St
Field 6: Sunny St
Field 7: Crossroads

The user clicks each 'waypoint' that he believes is the correct order, as
each one is clicked, assuming it is the correct choice, it is copied to the
'Target' Form/Table, if it is not the correct choice, it doesn't get copied,
instead the user is able to make another selecttio until he gets them all
right. Eventually, he builds the correct route and is given a cookie or his
efforts.

All this works perfectly, (which is why I want a form/code based solution
and not have to re-engineer a query based solution). But what I now want to
do is have another button that when the user presses it, it copies the entire
correct route in sequence, except those waypoints that are marked 'unmapped',
eg: roundabout, crossroads, etc.

make sense?

:

That explains more where you hope to get. Now, why are you "moving" data
around? Could a query that returns data be a solution, or are you creating
a new table?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

No prob wit explaining things. I just thought it best to be brief: I am
trying to get Googlemaps make a map for me, but it can only work on real
road
names, things like roundabouts and other obscure non-classified places
gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my code to
say:

check if this is marked not mapped, if it is, then ignore it and move to
the
next field to be copied, and so on...

does this all make sense?



Jeff Boyce said:
You've described "how" you are trying to do something (iterating through
a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be
snoopy
.... but there's a chance that if the newsgroup readers understood better
what business value you hope to add, they might be able to offer
alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

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
 
J

Jeff Boyce

I believe I understand the building-up of the route, based on waypoints. I
was asking about the need to copy the list to somewhere else. What will you
do with the list if it were copied somewhere else?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

The data being moved around is coming from a continous form and going to a
tabulated form with lots of fields that represent the 'waypoint' fields
for
my google route. This began life as a 'Route test' form for delivery
drivers.
The way it works is this:

Selector Form: (fields below are mixed in random order)

Field 1: Main St
Field 2: South St
Field 3: Long Road
Field 4: Roundabout
Field 5: Short St
Field 6: Sunny St
Field 7: Crossroads

The user clicks each 'waypoint' that he believes is the correct order, as
each one is clicked, assuming it is the correct choice, it is copied to
the
'Target' Form/Table, if it is not the correct choice, it doesn't get
copied,
instead the user is able to make another selecttio until he gets them all
right. Eventually, he builds the correct route and is given a cookie or
his
efforts.

All this works perfectly, (which is why I want a form/code based solution
and not have to re-engineer a query based solution). But what I now want
to
do is have another button that when the user presses it, it copies the
entire
correct route in sequence, except those waypoints that are marked
'unmapped',
eg: roundabout, crossroads, etc.

make sense?

:

That explains more where you hope to get. Now, why are you "moving" data
around? Could a query that returns data be a solution, or are you
creating
a new table?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

No prob wit explaining things. I just thought it best to be brief: I am
trying to get Googlemaps make a map for me, but it can only work on
real
road
names, things like roundabouts and other obscure non-classified places
gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my code
to
say:

check if this is marked not mapped, if it is, then ignore it and move
to
the
next field to be copied, and so on...

does this all make sense?



:

You've described "how" you are trying to do something (iterating
through
a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be
snoopy
.... but there's a chance that if the newsgroup readers understood
better
what business value you hope to add, they might be able to offer
alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

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
 
G

Guest

It simply serves as a custom route builder, the advantage of 'pick and copy'
is that the user can alter the route at any time and see clearer than if it
were say, tick boxes against the original list; that and the need for
integration into exisitng tables and queries and complex forms.

Jeff Boyce said:
I believe I understand the building-up of the route, based on waypoints. I
was asking about the need to copy the list to somewhere else. What will you
do with the list if it were copied somewhere else?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

The data being moved around is coming from a continous form and going to a
tabulated form with lots of fields that represent the 'waypoint' fields
for
my google route. This began life as a 'Route test' form for delivery
drivers.
The way it works is this:

Selector Form: (fields below are mixed in random order)

Field 1: Main St
Field 2: South St
Field 3: Long Road
Field 4: Roundabout
Field 5: Short St
Field 6: Sunny St
Field 7: Crossroads

The user clicks each 'waypoint' that he believes is the correct order, as
each one is clicked, assuming it is the correct choice, it is copied to
the
'Target' Form/Table, if it is not the correct choice, it doesn't get
copied,
instead the user is able to make another selecttio until he gets them all
right. Eventually, he builds the correct route and is given a cookie or
his
efforts.

All this works perfectly, (which is why I want a form/code based solution
and not have to re-engineer a query based solution). But what I now want
to
do is have another button that when the user presses it, it copies the
entire
correct route in sequence, except those waypoints that are marked
'unmapped',
eg: roundabout, crossroads, etc.

make sense?

:

That explains more where you hope to get. Now, why are you "moving" data
around? Could a query that returns data be a solution, or are you
creating
a new table?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jeff,

No prob wit explaining things. I just thought it best to be brief: I am
trying to get Googlemaps make a map for me, but it can only work on
real
road
names, things like roundabouts and other obscure non-classified places
gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my code
to
say:

check if this is marked not mapped, if it is, then ignore it and move
to
the
next field to be copied, and so on...

does this all make sense?



:

You've described "how" you are trying to do something (iterating
through
a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to be
snoopy
.... but there's a chance that if the newsgroup readers understood
better
what business value you hope to add, they might be able to offer
alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

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
 
J

Jeff Boyce

If I were designing a way to keep track of a series of steps (choices,
waypoints, satisfied requirements, etc.) that need to be kept in sequence, I
might take an approach like:

1. identify which step is first (from a list of possible steps, if
possible)
2. add a sequence number (could be hidden) that is one digit larger than
the previous
3. go to the next step and repeat the above.

I would use one table to hold some form of "sessionID" (to help identify
which steps belong to which ... "session"). I would use one table to hold
potential steps (see #1 above). I would use one table to hold
SelectedSessionSteps -- and this is where the SessionID, StepID, and
SequenceNumber would be placed.

Does that help at all?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
It simply serves as a custom route builder, the advantage of 'pick and
copy'
is that the user can alter the route at any time and see clearer than if
it
were say, tick boxes against the original list; that and the need for
integration into exisitng tables and queries and complex forms.

Jeff Boyce said:
I believe I understand the building-up of the route, based on waypoints.
I
was asking about the need to copy the list to somewhere else. What will
you
do with the list if it were copied somewhere else?

Regards

Jeff Boyce
Microsoft Office/Access MVP

efandango said:
Jeff,

The data being moved around is coming from a continous form and going
to a
tabulated form with lots of fields that represent the 'waypoint' fields
for
my google route. This began life as a 'Route test' form for delivery
drivers.
The way it works is this:

Selector Form: (fields below are mixed in random order)

Field 1: Main St
Field 2: South St
Field 3: Long Road
Field 4: Roundabout
Field 5: Short St
Field 6: Sunny St
Field 7: Crossroads

The user clicks each 'waypoint' that he believes is the correct order,
as
each one is clicked, assuming it is the correct choice, it is copied to
the
'Target' Form/Table, if it is not the correct choice, it doesn't get
copied,
instead the user is able to make another selecttio until he gets them
all
right. Eventually, he builds the correct route and is given a cookie or
his
efforts.

All this works perfectly, (which is why I want a form/code based
solution
and not have to re-engineer a query based solution). But what I now
want
to
do is have another button that when the user presses it, it copies the
entire
correct route in sequence, except those waypoints that are marked
'unmapped',
eg: roundabout, crossroads, etc.

make sense?

:


That explains more where you hope to get. Now, why are you "moving"
data
around? Could a query that returns data be a solution, or are you
creating
a new table?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jeff,

No prob wit explaining things. I just thought it best to be brief: I
am
trying to get Googlemaps make a map for me, but it can only work on
real
road
names, things like roundabouts and other obscure non-classified
places
gets
ignored and the mapping failsl; so I create the [Notmapped] field to
distinguish from the 'real' name places. So, essentialy I want my
code
to
say:

check if this is marked not mapped, if it is, then ignore it and
move
to
the
next field to be copied, and so on...

does this all make sense?



:

You've described "how" you are trying to do something (iterating
through
a
dataset, moving a value from one place to another).

Now, how about describing the "what" and "why"? I'm not asking to
be
snoopy
.... but there's a chance that if the newsgroup readers understood
better
what business value you hope to add, they might be able to offer
alternate
approaches to achieving it.

Regards

Jeff Boyce
Microsoft Office/Access MVP

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
 

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

Top