G
Guest
How do you display the results in a textbox from a query in an exit event of
a previous textbox?
a previous textbox?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
How do you display the results in a textbox from a query in an exit event of
a previous textbox?
fredg said:How do you display the results in a textbox from a query in an exit event of
a previous textbox?
Use a DLookUp.
If the query returns just one record:
[ControlName]=DLookUp("[FieldName]","QueryName")
If the query returns more than one record....
If [Somefield] is a Number datatype, use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] = " &
SomeNumberCriteria)
If [SomeField] is Text datatype use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] ='" &
SomeTextCriteria & "'")
In VBA help, look up DLookUp
as well as
Where clause + Restrict data to a subset of records.
krharrison said:How do you display the results in a textbox from a query in an exit event
of
a previous textbox?
fredg said:How do you display the results in a textbox from a query in an exit event
of
a previous textbox?
Use a DLookUp.
If the query returns just one record:
[ControlName]=DLookUp("[FieldName]","QueryName")
If the query returns more than one record....
If [Somefield] is a Number datatype, use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] = " &
SomeNumberCriteria)
If [SomeField] is Text datatype use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] ='" &
SomeTextCriteria & "'")
In VBA help, look up DLookUp
as well as
Where clause + Restrict data to a subset of records.
krharrison said:This worked beautifully ! ! ! Many thanks ! !
fredg said:How do you display the results in a textbox from a query in an exit
event of
a previous textbox?
Use a DLookUp.
If the query returns just one record:
[ControlName]=DLookUp("[FieldName]","QueryName")
If the query returns more than one record....
If [Somefield] is a Number datatype, use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] = " &
SomeNumberCriteria)
If [SomeField] is Text datatype use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] ='" &
SomeTextCriteria & "'")
In VBA help, look up DLookUp
as well as
Where clause + Restrict data to a subset of records.
krharrison said:This worked beautifully ! ! ! Many thanks ! !
fredg said:How do you display the results in a textbox from a query in an exit
event of
a previous textbox?
Use a DLookUp.
If the query returns just one record:
[ControlName]=DLookUp("[FieldName]","QueryName")
If the query returns more than one record....
If [Somefield] is a Number datatype, use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] = " &
SomeNumberCriteria)
If [SomeField] is Text datatype use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] ='" &
SomeTextCriteria & "'")
In VBA help, look up DLookUp
as well as
Where clause + Restrict data to a subset of records.
fredg said:How do you display the results in a textbox from a query in an exit event
of
a previous textbox?
Use a DLookUp.
If the query returns just one record:
[ControlName]=DLookUp("[FieldName]","QueryName")
If the query returns more than one record....
If [Somefield] is a Number datatype, use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] = " &
SomeNumberCriteria)
If [SomeField] is Text datatype use:
[ControlName]=DLookUp("[FieldName]","QueryName","[SomeField] ='" &
SomeTextCriteria & "'")
In VBA help, look up DLookUp
as well as
Where clause + Restrict data to a subset of records.
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.