Code to pull up correct record

  • Thread starter Thread starter google3luo359
  • Start date Start date
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
 
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....


"(e-mail address removed)" 來函:
 
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. :)
 
Back
Top