refering to field in data sheet view

O

OD

in a form i would use docmd.openform and refer to the field, this works fine.
I don't
want to have to create a form just to get the field data.

DoCmd.OpenTable "Users", , acReadOnly
DoCmd.GoToControl "UserName"
DoCmd.FindRecord varUserName, acEntire, , acSearchAll, , acCurrent,
FindFirst
varUserName = [UserName] '??????????
DoCmd.Close acTable, "Users"

Thanks
OD
 
T

tina

well, i don't see a question there. but i will say that the standard way of
retrieving a value from a table is to use a domain aggregate function, such
as DLookup(), DMax(), DMin(), DCount(), DSum(). suggest you read up on those
topics in Help and choose a function that will find the record you're after,
and return the field value you want.

hth
 
O

OD

Thanks I will lookup the fuction.

OD

tina said:
well, i don't see a question there. but i will say that the standard way of
retrieving a value from a table is to use a domain aggregate function, such
as DLookup(), DMax(), DMin(), DCount(), DSum(). suggest you read up on those
topics in Help and choose a function that will find the record you're after,
and return the field value you want.

hth


OD said:
in a form i would use docmd.openform and refer to the field, this works fine.
I don't
want to have to create a form just to get the field data.

DoCmd.OpenTable "Users", , acReadOnly
DoCmd.GoToControl "UserName"
DoCmd.FindRecord varUserName, acEntire, , acSearchAll, , acCurrent,
FindFirst
varUserName = [UserName] '??????????
DoCmd.Close acTable, "Users"

Thanks
OD
 

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