G
Guest
Hello, I have a command button on a form that opens a report in print
preview. This is an Access 97 secured db. I would like to use one button,
but have it include records based on the current user. For example, if user
ms1234 clicks the button, I would like data for Workgroups 1, 2 and 3. If
user dc9999 clicks the button, just display data for Workgroup 4. I think it
will look something like this, but need your help. Thanks! Mary
Function OpenProjectRpt()
Select Case CurrentUser
Case "ms1234"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “1†or “2†or “3â€
Case "at1234"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “4â€
Case "ms9876"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “1†or “4â€
Case Else
MsgBox "Restricted Database! Please verify Username and Password."
End Select
End Function
preview. This is an Access 97 secured db. I would like to use one button,
but have it include records based on the current user. For example, if user
ms1234 clicks the button, I would like data for Workgroups 1, 2 and 3. If
user dc9999 clicks the button, just display data for Workgroup 4. I think it
will look something like this, but need your help. Thanks! Mary
Function OpenProjectRpt()
Select Case CurrentUser
Case "ms1234"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “1†or “2†or “3â€
Case "at1234"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “4â€
Case "ms9876"
DoCmd.OpenReport "DailyProjectActivity"
WHERE Forms![Menu]![Workgroup] = “1†or “4â€
Case Else
MsgBox "Restricted Database! Please verify Username and Password."
End Select
End Function