AccessHawaii
MIS
I hope someone can help me with this. I currently have a function that applies a filter to a form based on a user's login. I'm using a DLookup function in VBA, which looks at a table that contains the user's login and department, which is used as the filter. It looks similiar to below.
Dim strUser as string
dim strFilter as string
strUser=CurrentUser
StrFilter=("[Department]","tblLogin","[Login]= strUser")
It works fine like this but now the users want to be able to be assigned to multiple departments so the DLookup function would need to pull multiple instances and concatenate the department(s) to be used in a filter.
The DLookup function only pulls a single record. Does anyone know a procedure in VBA where I can use the DLookup function and have it look for multiple instances of the records? Like in a For Next type of statement or something?
If this isn't possible is there another way I can accomplish this? Thanks.
Dim strUser as string
dim strFilter as string
strUser=CurrentUser
StrFilter=("[Department]","tblLogin","[Login]= strUser")
It works fine like this but now the users want to be able to be assigned to multiple departments so the DLookup function would need to pull multiple instances and concatenate the department(s) to be used in a filter.
The DLookup function only pulls a single record. Does anyone know a procedure in VBA where I can use the DLookup function and have it look for multiple instances of the records? Like in a For Next type of statement or something?
If this isn't possible is there another way I can accomplish this? Thanks.