G

Guest

thank you for the info....I'm trying it and want to make sure I have this
correct:

The table name containing the data is 'employeedata'
The field in that table containing the id number is 'employeeidnumber'
The field in that table containing the name of the person is 'employeename'
The name of the text box on the form where the id number is typed in is
'mdidnumber'
The name of the text box where I want to put the looked(pardon the grammar)
up name is 'mdname'

So the expression placed in the Control Source of the 'mdname' text box
would be:
Dlookup("[employeeidnumber]","employeedata","[mdidnumber]"="&ME!mdidnumber &"

Just want to make sure because I can't get it to work and don't know if it's
a syntax issue or something else...

thanks very much
Chris


hi,
you might try dlookup. relatively simple
field table filed control on form
DLookup("[PNumber]","tbl","[EmpID] ='" & Me!txtEmpID & "'"
DLookup("[name]", "tbl", "[EmpID] ='" & Me!txtEmpID & "'"
you can use this as the control source for the name
control and the phone number control
-----Original Message-----
Thanks for reading !

I have a table that contains name, phone number and id number. I have a
form that displays that data. What I want to do is have the user enter in
their ID number, then based on that the field for phone number and name would
populate in the appropriate text boxes.

For instance if the user typed 12345 in the employee ID text box, the
afterupdate event would trigger something to go look for that number in
tblemployees and upon finding it would populate the phone number and name in
the other text boxes.

I'm not using a combo box only because not every employee may be in it...but
can if it makes it easier.

Does anyone have a link or some advice for this please ?

thanks for reading this.

.
 
G

Guest

sorry for the title...that's what you get for posting while talking on the
phone

Chris said:
thank you for the info....I'm trying it and want to make sure I have this
correct:

The table name containing the data is 'employeedata'
The field in that table containing the id number is 'employeeidnumber'
The field in that table containing the name of the person is 'employeename'
The name of the text box on the form where the id number is typed in is
'mdidnumber'
The name of the text box where I want to put the looked(pardon the grammar)
up name is 'mdname'

So the expression placed in the Control Source of the 'mdname' text box
would be:
Dlookup("[employeeidnumber]","employeedata","[mdidnumber]"="&ME!mdidnumber &"

Just want to make sure because I can't get it to work and don't know if it's
a syntax issue or something else...

thanks very much
Chris


hi,
you might try dlookup. relatively simple
field table filed control on form
DLookup("[PNumber]","tbl","[EmpID] ='" & Me!txtEmpID & "'"
DLookup("[name]", "tbl", "[EmpID] ='" & Me!txtEmpID & "'"
you can use this as the control source for the name
control and the phone number control
-----Original Message-----
Thanks for reading !

I have a table that contains name, phone number and id number. I have a
form that displays that data. What I want to do is have the user enter in
their ID number, then based on that the field for phone number and name would
populate in the appropriate text boxes.

For instance if the user typed 12345 in the employee ID text box, the
afterupdate event would trigger something to go look for that number in
tblemployees and upon finding it would populate the phone number and name in
the other text boxes.

I'm not using a combo box only because not every employee may be in it...but
can if it makes it easier.

Does anyone have a link or some advice for this please ?

thanks for reading this.

.
 
J

John Vinson

On Thu, 13 Jan 2005 10:39:06 -0800, "Chris"

Chris, anonymous is the default user name in the web based newsreader.
It's best to Reply to messages rather than creating a new subject
line; and using (e-mail address removed) as a subject line
is not going to alert ANYBODY to your message.
thank you for the info....I'm trying it and want to make sure I have this
correct:

The table name containing the data is 'employeedata'
The field in that table containing the id number is 'employeeidnumber'
The field in that table containing the name of the person is 'employeename'
The name of the text box on the form where the id number is typed in is
'mdidnumber'
The name of the text box where I want to put the looked(pardon the grammar)
up name is 'mdname'

So the expression placed in the Control Source of the 'mdname' text box
would be:
Dlookup("[employeeidnumber]","employeedata","[mdidnumber]"="&ME!mdidnumber &"

Just want to make sure because I can't get it to work and don't know if it's
a syntax issue or something else...

You've got some extra quotes. The third argument to DLookUp should be
a text string containing a valid SQL WHERE clause without the word
WHERE. In this case, if mdidnumber is 318, you want it to end up
containing

[mdidnumber] = 318

To build it up, combine the pieces: string constants and form
variables.

Try

DLookUp("[employeeidnumber]", "employeedata", "[mdidnumber]=" &
Me!mdidnumber)

This will combine the string constant

"[mdidnumber]="

with whatever numeric value is in the textbox named mdidnumber to
generate the needed criterion.

John W. Vinson[MVP]
 
J

John Vinson

sorry for the title...that's what you get for posting while talking on the
phone

ah! Didn't look down the list. See my answer in that message thread.

John W. Vinson[MVP]
 
G

Guest

thanks very much for the response John :cool:


John Vinson said:
On Thu, 13 Jan 2005 10:39:06 -0800, "Chris"

Chris, anonymous is the default user name in the web based newsreader.
It's best to Reply to messages rather than creating a new subject
line; and using (e-mail address removed) as a subject line
is not going to alert ANYBODY to your message.
thank you for the info....I'm trying it and want to make sure I have this
correct:

The table name containing the data is 'employeedata'
The field in that table containing the id number is 'employeeidnumber'
The field in that table containing the name of the person is 'employeename'
The name of the text box on the form where the id number is typed in is
'mdidnumber'
The name of the text box where I want to put the looked(pardon the grammar)
up name is 'mdname'

So the expression placed in the Control Source of the 'mdname' text box
would be:
Dlookup("[employeeidnumber]","employeedata","[mdidnumber]"="&ME!mdidnumber &"

Just want to make sure because I can't get it to work and don't know if it's
a syntax issue or something else...

You've got some extra quotes. The third argument to DLookUp should be
a text string containing a valid SQL WHERE clause without the word
WHERE. In this case, if mdidnumber is 318, you want it to end up
containing

[mdidnumber] = 318

To build it up, combine the pieces: string constants and form
variables.

Try

DLookUp("[employeeidnumber]", "employeedata", "[mdidnumber]=" &
Me!mdidnumber)

This will combine the string constant

"[mdidnumber]="

with whatever numeric value is in the textbox named mdidnumber to
generate the needed criterion.

John W. Vinson[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