Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter form

Status
Not open for further replies.

Spyridon

Technical User
Jun 27, 2003
45
US
Can I filter a subform with a dlookup statement?

I have a subform that is based on a query. Each individual user in the database has his/her own salesID. This salesID is written to a LocalUser table when someone logs on, and then the LocalUser table's records are erased when they exit.

In my sales entry subform I need only the records for the current salesID to populate, so they can view them and add a new one. In my query I had the salesID field with
DLookUp("[SalesID]","LocalUser")
That worked fine, they could then add a new record, but they couldn't view their old ones. I took it out, and now they can add records, but they can also view other people's orders, which I don't want.

SOooo, I was wondering if I could set something up in VB to filter the subform by DLookUp("[SalesID]","LocalUser").
Now I'm not sure, I might be getting out of one pickle and into another one, if I filtered the form I don't know if I would be able to add new records or not...

Anyway, thanks to anyone for any help, I hope I have't been too confusing in my explanation.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top