Code to pull up correct record

G

google3luo359

If you have several records in a table that belong to a user ID, and
you know the value of a key field in that table that will select the
record you need, let's say it's value '22'. What code would you use to
display that record?

TIA Ric
 
R

Rainbow01

from Rainbow01 Hong Kong

many methods in different situation :
1) if you want to open a form to only show that record, Docmd.OpenForm
YourFormName, , , you condition
2) if you want to find record in subform(table view or continous form view),
use Docmd.FindRecord ......
3) if you want to find a field value of record from a table, use Dlookup
function in textbox, or in VBA coding....


"[email protected]" 來函:
 
G

google3luo359

Rainbow01 said:
from Rainbow01 Hong Kong

many methods in different situation :
1) if you want to open a form to only show that record, Docmd.OpenForm
YourFormName, , , you condition
2) if you want to find record in subform(table view or continous form view),
use Docmd.FindRecord ......
3) if you want to find a field value of record from a table, use Dlookup
function in textbox, or in VBA coding....


Thanks Rainbow, I got it working now. :)
 
Top