Passing query parameters from a form

A

AbuFarooq

Hi All...

I am new to database programming. I need a help in designing some forms
and queries.

I designed a query which takes a value entered in a text control box in
a form, and subtractes it from a field in a table. when I run th query
from the query designer window, it prompt me for the value to subtract,
and update the required table perfectly. However, when I try to enter a
value in the text box in the form, and click a button linked to a macro
which runs the query, the query is executed, but the requiered value in
the tabel becomes empty.

I guess the problem might be related to passing the parameter form the
form to the query.

Any advise ?
 
M

Michel Walsh

Hi,


In the query, use the syntax:

FORMS!FormNameHere!ControlNameHere


and run the query when the mentioned form is opened, and whenthe control
name has some validated value in it.


FORMS is a keyword to be typed as it is. Form name and Control name are to
fit the ones in your case.


Hoping it may help,
Vanderghast, Access MVP
 

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