how to get table values into variable

  • Thread starter Thread starter ezil
  • Start date Start date
E

ezil

The following codes are working perfectly

a=forms!forms1.field1
forms!forms1.field1=a

like this any code is there for getting values directly from table ?

i tried
a= tables!table1.field1
but it is not working
 
Search the help for DLookup (or go to www.allenbrowne.com/tips.html and
import his ELookup function).

variable = DLookup("fieldname", "tablename", "where clause")

will return null if no values are found, so you may want to wrap with the
Nz() function:

variable = Nz(DLookup("fieldname", "tablename", "whereclause"), "")


hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
variable = DLookup("fieldname", "tablename", "where clause")
this is the code for getting table value into variable
like that how to change table value to variable value
(i.e table1.field1=variable)
 
CurrentDb.Execute _
"UPDATE tablename " & _
"SET fieldname=value " & _
"WHERE fieldname=value"

you're welcome

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top