Auto enter data

I

Ian Tranter

I need code or help with entering data automatically.
In the database I have a lookup table called M_WML with
three fields in it named PSTK OPNO & SETUP.

On my form I have controls named the same, how do I get
the SETUP control automatically filled in using PSTK &
OPNO as filters?????
 
N

Nikos Yannacopoulos

Ian,

One way to do this without using code is to create a one
action (SetValue) macro with Item [SETUP] and expression

=DLookUp("[M_WML]![SETUP]","M_WML"," [M_WML]![PSTK] =
Forms![FormName]![PSTK] And [M_WML]![OPNO] = Forms!
[FormName]![OPNO] ")

FormName being the name of the Form, and assuming the
control names on your form are the same as the field names
in the table (otherwise modify accordingly).
Then you need to put the macro in the After Update event
of the first two (or just the second) controls.

Nikos Y. (nyannaco at in dot com)
 
I

Ian Tranter

DUDE Thanx works a treat

-----Original Message-----
Ian,

One way to do this without using code is to create a one
action (SetValue) macro with Item [SETUP] and expression

=DLookUp("[M_WML]![SETUP]","M_WML"," [M_WML]![PSTK] =
Forms![FormName]![PSTK] And [M_WML]![OPNO] = Forms!
[FormName]![OPNO] ")

FormName being the name of the Form, and assuming the
control names on your form are the same as the field names
in the table (otherwise modify accordingly).
Then you need to put the macro in the After Update event
of the first two (or just the second) controls.

Nikos Y. (nyannaco at in dot com)
-----Original Message-----
I need code or help with entering data automatically.
In the database I have a lookup table called M_WML with
three fields in it named PSTK OPNO & SETUP.

On my form I have controls named the same, how do I get
the SETUP control automatically filled in using PSTK &
OPNO as filters?????

.
.
 

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