Auto enter data

  • Thread starter Thread starter Ian Tranter
  • Start date Start date
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?????
 
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)
 
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?????

.
.
 
Back
Top