K
krharrison
How do you display the results in a textbox from a query in an exit event of
a previous textbox?
a previous textbox?
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.