Help Me Please

P

Paul

OK. I need a macro, I think, when I click on it on a form
from a button I want it to run a query and transfer data
from one field of the query to my form. How is this
possible. Please reply asap coz me assignments in very
soon. lol
 
G

Guest

Hi,

I am assuming you want the data returned based on
something entered into the form. Try the following:

Open form in design mode. Click properties of field that
is being filled in on form. Click on lost focus.

Fill the following in:

Forms![field_to_fill_in]=DLookup
("[returned_field_from_table ]", "Table_name", "[Table_fiel
d_to_match] =" & Forms![Form_name]!form_entered_field)

field_to_fill_in <-- field on your form that you are
populating from the search.
returned_field_from_table <-- the data just retrieved
Table_name <-- table being searched
Table_field_to_match <-- field in table that links to
field_to_fill_in
Form_entered_field <-- field on form that was typed into

Hope this helps you.
 

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