Help reqd. with the Macro "SetValue" property.

F

Frank Martin

I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the Combo's
"AfterUpdate" property.

This works very well for one field, but how
can I use this one Macro to fill in more than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here are
filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I can
insert values into more than one field.

Frank
 
A

Arvin Meyer [MVP]

In a macro group, you can have multiple macros. From the view menu, turn on
the "Macro Names" column and give your macro a name.

Now you can add additional Actions, by adding "..." (3 dots without the
quotes) in the name column, and SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written a macro in well over 10 years, so
I'm not sure if the 3 dots are still used. In Code it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
 
F

Frank Martin

Thank you very much. I will try this.
Regards, Frank


message
In a macro group, you can have multiple
macros. From the view menu, turn on the
"Macro Names" column and give your macro a
name.

Now you can add additional Actions, by
adding "..." (3 dots without the quotes) in
the name column, and SetValue again with
the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written
a macro in well over 10 years, so I'm not
sure if the 3 dots are still used. In Code
it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



message
I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the
Combo's
"AfterUpdate" property.

This works very well for one field, but
how
can I use this one Macro to fill in more
than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here
are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I
can
insert values into more than one field.

Frank
 
F

Frank Martin

message
In a macro group, you can have multiple
macros. From the view menu, turn on the
"Macro Names" column and give your macro a
name.

Now you can add additional Actions, by
adding "..." (3 dots without the quotes) in
the name column, and SetValue again with
the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written
a macro in well over 10 years, so I'm not
sure if the 3 dots are still used. In Code
it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



message
I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the
Combo's
"AfterUpdate" property.

This works very well for one field, but
how
can I use this one Macro to fill in more
than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here
are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I
can
insert values into more than one field.

Frank
 
F

Frank Martin

This method works but now I need some way to
send a value to a control on an unrelated
form, and the "setvalue" function does not
work.

Is there something similar that will do the
job?

Frank


message
In a macro group, you can have multiple
macros. From the view menu, turn on the
"Macro Names" column and give your macro a
name.

Now you can add additional Actions, by
adding "..." (3 dots without the quotes) in
the name column, and SetValue again with
the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written
a macro in well over 10 years, so I'm not
sure if the 3 dots are still used. In Code
it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



message
I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the
Combo's
"AfterUpdate" property.

This works very well for one field, but
how
can I use this one Macro to fill in more
than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here
are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I
can
insert values into more than one field.

Frank
 
K

Ken Snell \(MVP\)

Define what you mean by ' the "setvalue" function does not work' statement.
SetValue is used to write a specific value into a control on an open form.
--

Ken Snell
<MS ACCESS MVP>



Frank Martin said:
This method works but now I need some way to send a value to a control on
an unrelated form, and the "setvalue" function does not work.

Is there something similar that will do the job?

Frank


Arvin Meyer said:
In a macro group, you can have multiple macros. From the view menu, turn
on the "Macro Names" column and give your macro a name.

Now you can add additional Actions, by adding "..." (3 dots without the
quotes) in the name column, and SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written a macro in well over 10 years,
so I'm not sure if the 3 dots are still used. In Code it would be
simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



Frank Martin said:
I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the Combo's
"AfterUpdate" property.

This works very well for one field, but how
can I use this one Macro to fill in more than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I can
insert values into more than one field.

Frank
 
F

Frank Martin

I can insert a value in an open form OK with
the macro SetValue funtion, but not into an
unopened form or query. Now I need to do
it for an unopened form or query.

The reason is to insert a value (boolean)
into a field of the lookup macro so that I
can filter out values I have already used.

Frank


"Ken Snell (MVP)"
message
Define what you mean by ' the "setvalue"
function does not work' statement. SetValue
is used to write a specific value into a
control on an open form.
--

Ken Snell
<MS ACCESS MVP>



message
This method works but now I need some way
to send a value to a control on an
unrelated form, and the "setvalue"
function does not work.

Is there something similar that will do
the job?

Frank


message
In a macro group, you can have multiple
macros. From the view menu, turn on the
"Macro Names" column and give your macro
a name.

Now you can add additional Actions, by
adding "..." (3 dots without the quotes)
in the name column, and SetValue again
with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't
written a macro in well over 10 years, so
I'm not sure if the 3 dots are still
used. In Code it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



in message
I have to append a table with some
records
derived from a query.

I can convert a field to a Combo and
then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd
fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the
Combo's
"AfterUpdate" property.

This works very well for one field, but
how
can I use this one Macro to fill in more
than
one field? (there are three.)

There are two fields at the bottom of
this
Macro (the "SetValue" case), which, here
are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that
I can
insert values into more than one field.

Frank
 
K

Ken Snell \(MVP\)

You cannot insert a value into an unopened form. You also cannot insert a
value into an unopened query. You can filter a query so that it will limit
its records when it runs, but this likely will require VBA programming to
do. You can filter a form as it opens (the WHERE argument for the OpenForm
action).

Can you tell us specifically what you are wanting to do with this value --
step-by-step would be good -- so that we can assist you with a solution?
--

Ken Snell
<MS ACCESS MVP>






Frank Martin said:
I can insert a value in an open form OK with the macro SetValue funtion,
but not into an unopened form or query. Now I need to do it for an
unopened form or query.

The reason is to insert a value (boolean) into a field of the lookup macro
so that I can filter out values I have already used.

Frank


Ken Snell (MVP) said:
Define what you mean by ' the "setvalue" function does not work'
statement. SetValue is used to write a specific value into a control on
an open form.
--

Ken Snell
<MS ACCESS MVP>



Frank Martin said:
This method works but now I need some way to send a value to a control
on an unrelated form, and the "setvalue" function does not work.

Is there something similar that will do the job?

Frank


In a macro group, you can have multiple macros. From the view menu,
turn on the "Macro Names" column and give your macro a name.

Now you can add additional Actions, by adding "..." (3 dots without the
quotes) in the name column, and SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written a macro in well over 10
years, so I'm not sure if the 3 dots are still used. In Code it would
be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the Combo's
"AfterUpdate" property.

This works very well for one field, but how
can I use this one Macro to fill in more than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I can
insert values into more than one field.

Frank
 
F

Frank Martin

I have to enter creditor payments into the
general ledger.

I do this by having a combo box in a ledger
field which calls up the previously-entered
"SuppPayments" query, which contains all
payments recorded as cheques are drawn.

They are not entered into the ledger until
they appear on the bank statement.
Therefore I have then to consult the
"SuppPayments" query (via the combo above)
and insert the statement values into the
ledger with the "SetValue" macro.

My problem is to filter from the
"SuppPayments" query all the transactions
that have now been entered into the ledger so
that they no longer appear in the combo
(there a several thousand.)

I seek to do this by inserting a value (
Boolean or otherwise) into the "SuppPayments"
query *from the ledger combo* so that this
can be the basis of a filter.

Regards, Frank


PS The tables relating to the ledger &
SuppPayments are not related, and it might be
very difficult to make them so.














"Ken Snell (MVP)"
message
You cannot insert a value into an unopened
form. You also cannot insert a value into
an unopened query. You can filter a query
so that it will limit its records when it
runs, but this likely will require VBA
programming to do. You can filter a form as
it opens (the WHERE argument for the
OpenForm action).

Can you tell us specifically what you are
wanting to do with this value --
step-by-step would be good -- so that we
can assist you with a solution?
--

Ken Snell
<MS ACCESS MVP>






message
I can insert a value in an open form OK
with the macro SetValue funtion, but not
into an unopened form or query. Now I
need to do it for an unopened form or
query.

The reason is to insert a value (boolean)
into a field of the lookup macro so that I
can filter out values I have already used.

Frank


"Ken Snell (MVP)"
in message
Define what you mean by ' the "setvalue"
function does not work' statement.
SetValue is used to write a specific
value into a control on an open form.
--

Ken Snell
<MS ACCESS MVP>



in message
This method works but now I need some
way to send a value to a control on an
unrelated form, and the "setvalue"
function does not work.

Is there something similar that will do
the job?

Frank


message
In a macro group, you can have multiple
macros. From the view menu, turn on the
"Macro Names" column and give your
macro a name.

Now you can add additional Actions, by
adding "..." (3 dots without the
quotes) in the name column, and
SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't
written a macro in well over 10 years,
so I'm not sure if the 3 dots are still
used. In Code it would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Frank Martin" <[email protected]>
wrote in message
I have to append a table with some
records
derived from a query.

I can convert a field to a Combo and
then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd
fields.

But this will conflict with all the
old
values in this field.

Therefore I have to use a Macro via
its
"SetValue" property, triggered by the
Combo's
"AfterUpdate" property.

This works very well for one field,
but how
can I use this one Macro to fill in
more than
one field? (there are three.)

There are two fields at the bottom of
this
Macro (the "SetValue" case), which,
here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so
that I can
insert values into more than one
field.

Frank
 
K

Ken Snell \(MVP\)

What I recommend is that you add (if it's not already there) a field in the
table that holds the records that are filling the SuppPayments query, and
this field would be a Boolean field that is True if it's been on a
statement, or False if it's not. You'd then use this field as a criterion in
your combobox's RowSource query to filter out SuppPayments records that are
on statements.

You then may want a form that allows you to see records from the
SuppPayments data and let's you edit the data in that Boolean field to show
that the record is now on a statement. Let this form do the updates to the
table so that your SuppPayments combobox query works as you wish.
--

Ken Snell
<MS ACCESS MVP>




Frank Martin said:
I have to enter creditor payments into the general ledger.

I do this by having a combo box in a ledger field which calls up the
previously-entered "SuppPayments" query, which contains all payments
recorded as cheques are drawn.

They are not entered into the ledger until they appear on the bank
statement. Therefore I have then to consult the "SuppPayments" query (via
the combo above) and insert the statement values into the ledger with the
"SetValue" macro.

My problem is to filter from the "SuppPayments" query all the transactions
that have now been entered into the ledger so that they no longer appear
in the combo (there a several thousand.)

I seek to do this by inserting a value ( Boolean or otherwise) into the
"SuppPayments" query *from the ledger combo* so that this can be the basis
of a filter.

Regards, Frank


PS The tables relating to the ledger & SuppPayments are not related, and
it might be very difficult to make them so.














Ken Snell (MVP) said:
You cannot insert a value into an unopened form. You also cannot insert a
value into an unopened query. You can filter a query so that it will
limit its records when it runs, but this likely will require VBA
programming to do. You can filter a form as it opens (the WHERE argument
for the OpenForm action).

Can you tell us specifically what you are wanting to do with this
value -- step-by-step would be good -- so that we can assist you with a
solution?
--

Ken Snell
<MS ACCESS MVP>






Frank Martin said:
I can insert a value in an open form OK with the macro SetValue funtion,
but not into an unopened form or query. Now I need to do it for an
unopened form or query.

The reason is to insert a value (boolean) into a field of the lookup
macro so that I can filter out values I have already used.

Frank


Define what you mean by ' the "setvalue" function does not work'
statement. SetValue is used to write a specific value into a control on
an open form.
--

Ken Snell
<MS ACCESS MVP>



This method works but now I need some way to send a value to a control
on an unrelated form, and the "setvalue" function does not work.

Is there something similar that will do the job?

Frank


In a macro group, you can have multiple macros. From the view menu,
turn on the "Macro Names" column and give your macro a name.

Now you can add additional Actions, by adding "..." (3 dots without
the quotes) in the name column, and SetValue again with the value
of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written a macro in well over 10
years, so I'm not sure if the 3 dots are still used. In Code it would
be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the Combo's
"AfterUpdate" property.

This works very well for one field, but how
can I use this one Macro to fill in more than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I can
insert values into more than one field.

Frank
 
F

Frank Martin

Thanks; I have put a subform based on
"SuppPayments" onto the Ledger form, and yes
I can now put a marker (a text value "Y")
onto the field in the subform from the Ledger
form.

But the marker is just dumped into the field
of the first record of the subform
"SuppPayments".

What I need is for the marker "Y" to go to
the record in the subform corressponding to
the cheque number selected in the combo. Is
there some way to configure the macro
"SetValue" property for this to happen? I
have the fields for this case in the
"SetValue" macro set as follows: ("Chk" is
the marker field.)

ITEM:
[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![Chk]

EXPRESSION:
"Y"

Thank you for all the help.
Frank






"Ken Snell (MVP)"
message
What I recommend is that you add (if it's
not already there) a field in the table
that holds the records that are filling the
SuppPayments query, and this field would be
a Boolean field that is True if it's been
on a statement, or False if it's not. You'd
then use this field as a criterion in your
combobox's RowSource query to filter out
SuppPayments records that are on
statements.

You then may want a form that allows you to
see records from the SuppPayments data and
let's you edit the data in that Boolean
field to show that the record is now on a
statement. Let this form do the updates to
the table so that your SuppPayments
combobox query works as you wish.
--

Ken Snell
<MS ACCESS MVP>




message
I have to enter creditor payments into the
general ledger.

I do this by having a combo box in a
ledger field which calls up the
previously-entered "SuppPayments" query,
which contains all payments recorded as
cheques are drawn.

They are not entered into the ledger until
they appear on the bank statement.
Therefore I have then to consult the
"SuppPayments" query (via the combo above)
and insert the statement values into the
ledger with the "SetValue" macro.

My problem is to filter from the
"SuppPayments" query all the transactions
that have now been entered into the ledger
so that they no longer appear in the combo
(there a several thousand.)

I seek to do this by inserting a value (
Boolean or otherwise) into the
"SuppPayments" query *from the ledger
combo* so that this can be the basis of a
filter.

Regards, Frank


PS The tables relating to the ledger &
SuppPayments are not related, and it might
be very difficult to make them so.














"Ken Snell (MVP)"
in message
You cannot insert a value into an
unopened form. You also cannot insert a
value into an unopened query. You can
filter a query so that it will limit its
records when it runs, but this likely
will require VBA programming to do. You
can filter a form as it opens (the WHERE
argument for the OpenForm action).

Can you tell us specifically what you are
wanting to do with this value --
step-by-step would be good -- so that we
can assist you with a solution?
--

Ken Snell
<MS ACCESS MVP>






in message
I can insert a value in an open form OK
with the macro SetValue funtion, but not
into an unopened form or query. Now I
need to do it for an unopened form or
query.

The reason is to insert a value
(boolean) into a field of the lookup
macro so that I can filter out values I
have already used.

Frank


"Ken Snell (MVP)"
in message
Define what you mean by ' the
"setvalue" function does not work'
statement. SetValue is used to write a
specific value into a control on an
open form.
--

Ken Snell
<MS ACCESS MVP>



"Frank Martin" <[email protected]>
wrote in message
This method works but now I need some
way to send a value to a control on an
unrelated form, and the "setvalue"
function does not work.

Is there something similar that will
do the job?

Frank


message
In a macro group, you can have
multiple macros. From the view menu,
turn on the "Macro Names" column and
give your macro a name.

Now you can add additional Actions,
by adding "..." (3 dots without the
quotes) in the name column, and
SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't
written a macro in well over 10
years, so I'm not sure if the 3 dots
are still used. In Code it would be
simpler:

Me.[LedgerTxns].[Form]![TxnWhatever]
=
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Frank Martin" <[email protected]>
wrote in message
I have to append a table with some
records
derived from a query.

I can convert a field to a Combo and
then
normally use this with the
expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd
fields.

But this will conflict with all the
old
values in this field.

Therefore I have to use a Macro via
its
"SetValue" property, triggered by
the Combo's
"AfterUpdate" property.

This works very well for one field,
but how
can I use this one Macro to fill in
more than
one field? (there are three.)

There are two fields at the bottom
of this
Macro (the "SetValue" case), which,
here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so
that I can
insert values into more than one
field.

Frank
 
K

Ken Snell \(MVP\)

Before you run the SetValue action, you need to "move" the subform to the
appropriate record that needs to be updated.

--

Ken Snell
<MS ACCESS MVP>


Frank Martin said:
Thanks; I have put a subform based on "SuppPayments" onto the Ledger
form, and yes I can now put a marker (a text value "Y") onto the field in
the subform from the Ledger form.

But the marker is just dumped into the field of the first record of the
subform "SuppPayments".

What I need is for the marker "Y" to go to the record in the subform
corressponding to the cheque number selected in the combo. Is there some
way to configure the macro "SetValue" property for this to happen? I
have the fields for this case in the "SetValue" macro set as follows:
("Chk" is the marker field.)

ITEM:
[Forms]![FrmLedgerAccnts]![QrySuppPayments subform].[Form]![Chk]

EXPRESSION:
"Y"

Thank you for all the help.
Frank






Ken Snell (MVP) said:
What I recommend is that you add (if it's not already there) a field in
the table that holds the records that are filling the SuppPayments query,
and this field would be a Boolean field that is True if it's been on a
statement, or False if it's not. You'd then use this field as a criterion
in your combobox's RowSource query to filter out SuppPayments records
that are on statements.

You then may want a form that allows you to see records from the
SuppPayments data and let's you edit the data in that Boolean field to
show that the record is now on a statement. Let this form do the updates
to the table so that your SuppPayments combobox query works as you wish.
--

Ken Snell
<MS ACCESS MVP>




Frank Martin said:
I have to enter creditor payments into the general ledger.

I do this by having a combo box in a ledger field which calls up the
previously-entered "SuppPayments" query, which contains all payments
recorded as cheques are drawn.

They are not entered into the ledger until they appear on the bank
statement. Therefore I have then to consult the "SuppPayments" query
(via the combo above) and insert the statement values into the ledger
with the "SetValue" macro.

My problem is to filter from the "SuppPayments" query all the
transactions that have now been entered into the ledger so that they no
longer appear in the combo (there a several thousand.)

I seek to do this by inserting a value ( Boolean or otherwise) into the
"SuppPayments" query *from the ledger combo* so that this can be the
basis of a filter.

Regards, Frank


PS The tables relating to the ledger & SuppPayments are not related,
and it might be very difficult to make them so.














You cannot insert a value into an unopened form. You also cannot insert
a value into an unopened query. You can filter a query so that it will
limit its records when it runs, but this likely will require VBA
programming to do. You can filter a form as it opens (the WHERE
argument for the OpenForm action).

Can you tell us specifically what you are wanting to do with this
value -- step-by-step would be good -- so that we can assist you with
a solution?
--

Ken Snell
<MS ACCESS MVP>






I can insert a value in an open form OK with the macro SetValue
funtion, but not into an unopened form or query. Now I need to do it
for an unopened form or query.

The reason is to insert a value (boolean) into a field of the lookup
macro so that I can filter out values I have already used.

Frank


Define what you mean by ' the "setvalue" function does not work'
statement. SetValue is used to write a specific value into a control
on an open form.
--

Ken Snell
<MS ACCESS MVP>



This method works but now I need some way to send a value to a
control on an unrelated form, and the "setvalue" function does not
work.

Is there something similar that will do the job?

Frank


In a macro group, you can have multiple macros. From the view menu,
turn on the "Macro Names" column and give your macro a name.

Now you can add additional Actions, by adding "..." (3 dots without
the quotes) in the name column, and SetValue again with the value
of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't written a macro in well over 10
years, so I'm not sure if the 3 dots are still used. In Code it
would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever] =
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



I have to append a table with some records
derived from a query.

I can convert a field to a Combo and then
normally use this with the expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd fields.

But this will conflict with all the old
values in this field.

Therefore I have to use a Macro via its
"SetValue" property, triggered by the Combo's
"AfterUpdate" property.

This works very well for one field, but how
can I use this one Macro to fill in more than
one field? (there are three.)

There are two fields at the bottom of this
Macro (the "SetValue" case), which, here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so that I can
insert values into more than one field.

Frank
 
F

Frank Martin

Thanks.

I have tried this in a condition expression
just before the 'SetValue' entry in the
macro, which is:

[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![ChequeNumber]

In other words I want the 'Y' marker to be
inserted into the field where the cheque
numbers march in both the Ledger form &
SuppPayments subform.

Is the above expression OK, or should I use
the "Like" operator, and should I enclose the
expression in brackets and/or apostrophes?
Both fields involved are "Text" and have the
same size.

So far it's not working. I have Access2003.

Regards, Frank






"Ken Snell (MVP)"
message
Before you run the SetValue action, you
need to "move" the subform to the
appropriate record that needs to be
updated.

--

Ken Snell
<MS ACCESS MVP>


message
Thanks; I have put a subform based on
"SuppPayments" onto the Ledger form, and
yes I can now put a marker (a text value
"Y") onto the field in the subform from
the Ledger form.

But the marker is just dumped into the
field of the first record of the subform
"SuppPayments".

What I need is for the marker "Y" to go to
the record in the subform corressponding
to the cheque number selected in the
combo. Is there some way to configure
the macro "SetValue" property for this to
happen? I have the fields for this case
in the "SetValue" macro set as follows:
("Chk" is the marker field.)

ITEM:
[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![Chk]

EXPRESSION:
"Y"

Thank you for all the help.
Frank






"Ken Snell (MVP)"
in message
What I recommend is that you add (if it's
not already there) a field in the table
that holds the records that are filling
the SuppPayments query, and this field
would be a Boolean field that is True if
it's been on a statement, or False if
it's not. You'd then use this field as a
criterion in your combobox's RowSource
query to filter out SuppPayments records
that are on statements.

You then may want a form that allows you
to see records from the SuppPayments data
and let's you edit the data in that
Boolean field to show that the record is
now on a statement. Let this form do the
updates to the table so that your
SuppPayments combobox query works as you
wish.
--

Ken Snell
<MS ACCESS MVP>




in message
I have to enter creditor payments into
the general ledger.

I do this by having a combo box in a
ledger field which calls up the
previously-entered "SuppPayments" query,
which contains all payments recorded as
cheques are drawn.

They are not entered into the ledger
until they appear on the bank statement.
Therefore I have then to consult the
"SuppPayments" query (via the combo
above) and insert the statement values
into the ledger with the "SetValue"
macro.

My problem is to filter from the
"SuppPayments" query all the
transactions that have now been entered
into the ledger so that they no longer
appear in the combo (there a several
thousand.)

I seek to do this by inserting a value
( Boolean or otherwise) into the
"SuppPayments" query *from the ledger
combo* so that this can be the basis of
a filter.

Regards, Frank


PS The tables relating to the ledger &
SuppPayments are not related, and it
might be very difficult to make them so.














"Ken Snell (MVP)"
in message
You cannot insert a value into an
unopened form. You also cannot insert a
value into an unopened query. You can
filter a query so that it will limit
its records when it runs, but this
likely will require VBA programming to
do. You can filter a form as it opens
(the WHERE argument for the OpenForm
action).

Can you tell us specifically what you
are wanting to do with this value --
step-by-step would be good -- so that
we can assist you with a solution?
--

Ken Snell
<MS ACCESS MVP>






"Frank Martin" <[email protected]>
wrote in message
I can insert a value in an open form OK
with the macro SetValue funtion, but
not into an unopened form or query.
Now I need to do it for an unopened
form or query.

The reason is to insert a value
(boolean) into a field of the lookup
macro so that I can filter out values
I have already used.

Frank


"Ken Snell (MVP)"
<[email protected]>
wrote in message
Define what you mean by ' the
"setvalue" function does not work'
statement. SetValue is used to write
a specific value into a control on an
open form.
--

Ken Snell
<MS ACCESS MVP>



"Frank Martin" <[email protected]>
wrote in message
This method works but now I need
some way to send a value to a
control on an unrelated form, and
the "setvalue" function does not
work.

Is there something similar that will
do the job?

Frank


in message
In a macro group, you can have
multiple macros. From the view
menu, turn on the "Macro Names"
column and give your macro a name.

Now you can add additional Actions,
by adding "..." (3 dots without the
quotes) in the name column, and
SetValue again with the value of:

ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnWhatever]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](2)

Add as many as you need. I haven't
written a macro in well over 10
years, so I'm not sure if the 3
dots are still used. In Code it
would be simpler:

Me.[LedgerTxns].[Form]![TxnWhatever]
=
Me.[LedgerTxns].[Form]![Reference].[Column](2)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Frank Martin" <[email protected]>
wrote in message
I have to append a table with some
records
derived from a query.

I can convert a field to a Combo
and then
normally use this with the
expression
"[Reference].[Column].(2)" in the
ControlSource to fill in the reqd
fields.

But this will conflict with all
the old
values in this field.

Therefore I have to use a Macro
via its
"SetValue" property, triggered by
the Combo's
"AfterUpdate" property.

This works very well for one
field, but how
can I use this one Macro to fill
in more than
one field? (there are three.)

There are two fields at the bottom
of this
Macro (the "SetValue" case),
which, here are filled as
shown:


ITEM:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![TxnDescription]

EXPRESSION:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference].[Column](1)


Please help me fill this fields so
that I can
insert values into more than one
field.

Frank
 
K

Ken Snell \(MVP\)

Check out the FindRecord action for moving the subform to the desired
record. Then do the SetValue action.
--

Ken Snell
<MS ACCESS MVP>



Frank Martin said:
Thanks.

I have tried this in a condition expression just before the 'SetValue'
entry in the macro, which is:

[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![ChequeNumber]

In other words I want the 'Y' marker to be inserted into the field where
the cheque numbers march in both the Ledger form & SuppPayments subform.

Is the above expression OK, or should I use the "Like" operator, and
should I enclose the expression in brackets and/or apostrophes? Both
fields involved are "Text" and have the same size.

So far it's not working. I have Access2003.

Regards, Frank


Ken Snell (MVP) said:
Before you run the SetValue action, you need to "move" the subform to the
appropriate record that needs to be updated.
 
F

Frank Martin

Thanks
I have tried this and though I can access the
subform OK, the desired record is not
selected. The mark is always inserted into
the first record of the subform (unless I
manually select another subform record in
which case this one gets the marker.)

There seems to be something wrong with the
'condition' expression; is this put into the
"OpenForm" action or into the "GoToRecord"
action? And is the condition expression put
into the macro 'condition' column or the
Actions fields. e.g. why isn't it put into
the "Where Condition" of the "OpenForm"
action arguments?

Also, the "GoToRecord" action has arguments
of "Next" and "offset" which do not seem to
apply in this case.

Regards, Frank







"Ken Snell (MVP)"
message
Check out the FindRecord action for moving
the subform to the desired record. Then do
the SetValue action.
--

Ken Snell
<MS ACCESS MVP>



message
Thanks.

I have tried this in a condition
expression just before the 'SetValue'
entry in the macro, which is:

[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![ChequeNumber]

In other words I want the 'Y' marker to be
inserted into the field where the cheque
numbers march in both the Ledger form &
SuppPayments subform.

Is the above expression OK, or should I
use the "Like" operator, and should I
enclose the expression in brackets and/or
apostrophes? Both fields involved are
"Text" and have the same size.

So far it's not working. I have
Access2003.

Regards, Frank


"Ken Snell (MVP)"
in message
Before you run the SetValue action, you
need to "move" the subform to the
appropriate record that needs to be
updated.
 
K

Ken Snell \(MVP\)

I see that you've posted this question in the macros newsgroup, too. Rather
than have two volunteers trying to answer the same question in two places,
let's drop this thread and let the one in macros become the active one.

I don't know why you're trying to use the GoToRecord action, though... I
specifically suggested the FindRecord action.
--

Ken Snell
<MS ACCESS MVP>



Frank Martin said:
Thanks
I have tried this and though I can access the subform OK, the desired
record is not selected. The mark is always inserted into the first record
of the subform (unless I manually select another subform record in which
case this one gets the marker.)

There seems to be something wrong with the 'condition' expression; is
this put into the "OpenForm" action or into the "GoToRecord" action? And
is the condition expression put into the macro 'condition' column or the
Actions fields. e.g. why isn't it put into the "Where Condition" of the
"OpenForm" action arguments?

Also, the "GoToRecord" action has arguments of "Next" and "offset" which
do not seem to apply in this case.

Regards, Frank







Ken Snell (MVP) said:
Check out the FindRecord action for moving the subform to the desired
record. Then do the SetValue action.
--

Ken Snell
<MS ACCESS MVP>



Frank Martin said:
Thanks.

I have tried this in a condition expression just before the 'SetValue'
entry in the macro, which is:

[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![ChequeNumber]

In other words I want the 'Y' marker to be inserted into the field where
the cheque numbers march in both the Ledger form & SuppPayments subform.

Is the above expression OK, or should I use the "Like" operator, and
should I enclose the expression in brackets and/or apostrophes? Both
fields involved are "Text" and have the same size.

So far it's not working. I have Access2003.

Regards, Frank


Before you run the SetValue action, you need to "move" the subform to
the appropriate record that needs to be updated.
 
F

Frank Martin

I'm desperate; I've tried everything!

"Ken Snell (MVP)"
message
I see that you've posted this question in
the macros newsgroup, too. Rather than have
two volunteers trying to answer the same
question in two places, let's drop this
thread and let the one in macros become the
active one.

I don't know why you're trying to use the
GoToRecord action, though... I specifically
suggested the FindRecord action.
--

Ken Snell
<MS ACCESS MVP>



message
Thanks
I have tried this and though I can access
the subform OK, the desired record is not
selected. The mark is always inserted
into the first record of the subform
(unless I manually select another subform
record in which case this one gets the
marker.)

There seems to be something wrong with the
'condition' expression; is this put into
the "OpenForm" action or into the
"GoToRecord" action? And is the
condition expression put into the macro
'condition' column or the Actions fields.
e.g. why isn't it put into the "Where
Condition" of the "OpenForm" action
arguments?

Also, the "GoToRecord" action has
arguments of "Next" and "offset" which do
not seem to apply in this case.

Regards, Frank







"Ken Snell (MVP)"
in message
Check out the FindRecord action for
moving the subform to the desired record.
Then do the SetValue action.
--

Ken Snell
<MS ACCESS MVP>



in message
Thanks.

I have tried this in a condition
expression just before the 'SetValue'
entry in the macro, which is:

[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Reference]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![ChequeNumber]

In other words I want the 'Y' marker to
be inserted into the field where the
cheque numbers march in both the Ledger
form & SuppPayments subform.

Is the above expression OK, or should I
use the "Like" operator, and should I
enclose the expression in brackets
and/or apostrophes? Both fields involved
are "Text" and have the same size.

So far it's not working. I have
Access2003.

Regards, Frank


"Ken Snell (MVP)"
in message
Before you run the SetValue action, you
need to "move" the subform to the
appropriate record that needs to be
updated.
 
K

Ken Snell \(MVP\)

Steve Schapel, MVP, has posted what I believe is the solution for your
request in the macros newsgroup. He's suggested the same thing I did -- a
FindRecord action.
 
F

Frank Martin

I have tried this but it is not working.
Where do I put the linking expression:
[Forms]![FrmLedgerAccnts]![LedgerTxns].[Form]![Chk]=[Forms]![FrmLedgerAccnts]![QrySuppPayments
subform].[Form]![Chk]

Does it go into the "Condition column" or the
"Find What" argument?
Regards, Frank


"Ken Snell (MVP)"
message
 

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