Using Macros Set Value to fill in a field on a form

S

Stryder09

Okay this is a message I posted yesterday and I have been playing with it
since.

Stryder09 said:
I would like to have a macro set a word into a form field is this possible?
I've been asked to create a database for our supervisors to use when an
Employee is absent. I have a table with 5 fields to populate. Date, Shift,
Employee, Reason, Comments. I want them to click a button from a main form
that will put a different reason into the Reason field. (ex. Bereavement,
sick, so on and so on). So back to my question, is it possible to create a
macro that by push of a button named Bereavement open the form with the
Reason field already populated saying Bereavement. Then tomorrow they click
the sick button and the form opens up with the Reason Field populated with
sick?

Thought I should add some more information. I've tried to use Set VAlue in
macros but can't get it to work.

In Item I have [Forms]![frmE-Shift(New)]![Reasons].[DefaultValue]

but what do I put into the Expressions field so that it will type
Bereavement into the field when the form loads.

After playing I now have the Expressions field as "Bereavement", now when I
click on the macro it takes me to the form but the Reasons field is still
blank. When I look at the properties however I see in Default Value,
Bereavement is actually there it just is not showing up in the field or on
the table. If I put " " around it in now shows up.

So I am closer to where I want to be but what am I missing that is not
allowing it to populate on the form.

Any help would be appreciated.

Thanks,
 
K

KARL DEWEY

See my post to your yesterday.
Set the field and not the default ---- [Forms]![frmE-Shift(New)]![Reasons]

--
Build a little, test a little.


Stryder09 said:
Okay this is a message I posted yesterday and I have been playing with it
since.

Stryder09 said:
I would like to have a macro set a word into a form field is this possible?
I've been asked to create a database for our supervisors to use when an
Employee is absent. I have a table with 5 fields to populate. Date, Shift,
Employee, Reason, Comments. I want them to click a button from a main form
that will put a different reason into the Reason field. (ex. Bereavement,
sick, so on and so on). So back to my question, is it possible to create a
macro that by push of a button named Bereavement open the form with the
Reason field already populated saying Bereavement. Then tomorrow they click
the sick button and the form opens up with the Reason Field populated with
sick?

Thought I should add some more information. I've tried to use Set VAlue in
macros but can't get it to work.

In Item I have [Forms]![frmE-Shift(New)]![Reasons].[DefaultValue]

but what do I put into the Expressions field so that it will type
Bereavement into the field when the form loads.

After playing I now have the Expressions field as "Bereavement", now when I
click on the macro it takes me to the form but the Reasons field is still
blank. When I look at the properties however I see in Default Value,
Bereavement is actually there it just is not showing up in the field or on
the table. If I put " " around it in now shows up.

So I am closer to where I want to be but what am I missing that is not
allowing it to populate on the form.

Any help would be appreciated.

Thanks,
 
S

Stryder09

What do you mean by set the field not the default? Do you mean not the
DefaultValue? Sorry I am just learning access so I hope you can bare with me.

KARL DEWEY said:
See my post to your yesterday.
Set the field and not the default ---- [Forms]![frmE-Shift(New)]![Reasons]

--
Build a little, test a little.


Stryder09 said:
Okay this is a message I posted yesterday and I have been playing with it
since.

Stryder09 said:
I would like to have a macro set a word into a form field is this possible?
I've been asked to create a database for our supervisors to use when an
Employee is absent. I have a table with 5 fields to populate. Date, Shift,
Employee, Reason, Comments. I want them to click a button from a main form
that will put a different reason into the Reason field. (ex. Bereavement,
sick, so on and so on). So back to my question, is it possible to create a
macro that by push of a button named Bereavement open the form with the
Reason field already populated saying Bereavement. Then tomorrow they click
the sick button and the form opens up with the Reason Field populated with
sick?

Thought I should add some more information. I've tried to use Set VAlue in
macros but can't get it to work.

In Item I have [Forms]![frmE-Shift(New)]![Reasons].[DefaultValue]

but what do I put into the Expressions field so that it will type
Bereavement into the field when the form loads.

After playing I now have the Expressions field as "Bereavement", now when I
click on the macro it takes me to the form but the Reasons field is still
blank. When I look at the properties however I see in Default Value,
Bereavement is actually there it just is not showing up in the field or on
the table. If I put " " around it in now shows up.

So I am closer to where I want to be but what am I missing that is not
allowing it to populate on the form.

Any help would be appreciated.

Thanks,
 
S

Stryder09

Thanks Karl, you can ignore the other responses. I left off the Default and
now it works like I want it to.

KARL DEWEY said:
See my post to your yesterday.
Set the field and not the default ---- [Forms]![frmE-Shift(New)]![Reasons]

--
Build a little, test a little.


Stryder09 said:
Okay this is a message I posted yesterday and I have been playing with it
since.

Stryder09 said:
I would like to have a macro set a word into a form field is this possible?
I've been asked to create a database for our supervisors to use when an
Employee is absent. I have a table with 5 fields to populate. Date, Shift,
Employee, Reason, Comments. I want them to click a button from a main form
that will put a different reason into the Reason field. (ex. Bereavement,
sick, so on and so on). So back to my question, is it possible to create a
macro that by push of a button named Bereavement open the form with the
Reason field already populated saying Bereavement. Then tomorrow they click
the sick button and the form opens up with the Reason Field populated with
sick?

Thought I should add some more information. I've tried to use Set VAlue in
macros but can't get it to work.

In Item I have [Forms]![frmE-Shift(New)]![Reasons].[DefaultValue]

but what do I put into the Expressions field so that it will type
Bereavement into the field when the form loads.

After playing I now have the Expressions field as "Bereavement", now when I
click on the macro it takes me to the form but the Reasons field is still
blank. When I look at the properties however I see in Default Value,
Bereavement is actually there it just is not showing up in the field or on
the table. If I put " " around it in now shows up.

So I am closer to where I want to be but what am I missing that is not
allowing it to populate on the form.

Any help would be appreciated.

Thanks,
 

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