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
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