By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Update Based on Form Control Value

P: n/a
I have a form that users use to input the fiscal year for an update query.

I have that value (after input sitting in a public variable and a Form
control.

How do I get Access to use that value to update the FY in the table within
the general update query?

Thx for ideas/sources.
Jan 6 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Kc-Mass wrote:
I have a form that users use to input the fiscal year for an update query.

I have that value (after input sitting in a public variable and a Form
control.

How do I get Access to use that value to update the FY in the table within
the general update query?

Thx for ideas/sources.
Why would you need it in a public variable? You can access the form
directly.

UPDATE MyTable
SET MyField = Forms![MyFormName]![txtFiscalYear]
WHERE ....

in the QBE, click on the ellipsis and you can select the control on the
form that contains the value for the update. You don't need the public
variable at all.

or you could do something like:

CurrentDB.Execute "UPDATE MyTable SET MyField =" &
Forms![MyFormName]![txtFiscalYear]

Jan 6 '07 #2

P: n/a
Thanks for the info.

<pi********@hotmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
>
Kc-Mass wrote:
>I have a form that users use to input the fiscal year for an update
query.

I have that value (after input sitting in a public variable and a Form
control.

How do I get Access to use that value to update the FY in the table
within
the general update query?

Thx for ideas/sources.

Why would you need it in a public variable? You can access the form
directly.

UPDATE MyTable
SET MyField = Forms![MyFormName]![txtFiscalYear]
WHERE ....

in the QBE, click on the ellipsis and you can select the control on the
form that contains the value for the update. You don't need the public
variable at all.

or you could do something like:

CurrentDB.Execute "UPDATE MyTable SET MyField =" &
Forms![MyFormName]![txtFiscalYear]

Jan 6 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.