Access records by network user name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Having a problem trying to figure out how to get to another form from a main
form and have only the records for the network user name show up
automatically without getting all records. It's working using fosUsername
module but I'm getting all records in the table for all users as well as the
ones for the network login. I'm also showing the current date (key is
username+date) and it works fine as well. How can I not have all records show
up? Any help would be appreciated.

Thanks.
 
I would do it this way. The code below is for the Click event of the button
that would open the other form.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Compare Database
Option Explicit

Private Sub Command0_Click()

On Error GoTo ErrorHandler

DoCmd.OpenForm "frmMyForm", , , "[UserName] = """ & fosUsername & """"

Cleanup:
Exit Sub

ErrorHandler:
MsgBox Err.Number & ", " & Err.Description

Resume Cleanup

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top