User information

sandy6078

Take a deep breath
Local time
Yesterday, 23:19
Joined
Jul 17, 2007
Messages
135
Hello to all.

I have a table for security in which the user logs in, is welcomed and goes to the main menu. The form is set up as a tabbed form with one tab for team members. On the tab is an edit button to open up a form to add new team member or edit an existing member. I have been requested to install a button on the main form so when the user presses the command button a form will pop up with only the records in which the user is a team member.

tSecurity has the following tables SecurityID (PK), User, Password, etc.

tTeam has TeamID (PK), First, Last, email, Phone.

the "main" table is tInformation with 8DID as the PK

I would appreciate any help or ideas to help me get this database closer to completion.

Thanks.
 
Create a Query and have the Criteria set to the team. You can do this several ways but the one i suggfest is create a hidden form to "Store" information on the person who is logged in. and point the criteria to the test box on that hidden form. (to make a form Hidden make another form open it up as hidden on load.Note. this is an option when choosing the form you wish to load.)another way is thru global variables in VBA. then make your query open in a form or however you wish to present the data, and it will be filterd by team.
 
thanks, I'll give it a try.
 
The logon for a user is his email address. The first control is the network username, the next control is the ending of the user's email address which is defaulted to my companies email address(@blahblahblah.com). The control, txtUser which will be hidden is a concatenation of the username control and the control for the end of the email address. The logon form is open but invisible. After logging on, the menu is available . On the menu form is a command button for viewing the user's 8D's. I have a query and subsequent form for the 8D's.

Now for the problem, This is the code I am using for the command button.
Code:
Private Sub cmdViewMy8Ds_Click()
On Error GoTo Err_cmdViewMy8Ds_Click
      
   Dim strDocName As String
   Dim strLinkCriteria As String
   
   strDocName = "fMy8Ds"
   strLinkCriteria = "[EmailAddress] =" & Forms![frmUserLogon].[txtUser]

   
   Me.Visible = False
   DoCmd.OpenForm strDocName, , , strLinkCriteria

Exit_cmdViewMy8Ds_Click:
   Exit Sub

Err_cmdViewMy8Ds_Click:
   MsgBox Err.Description
   Resume Exit_cmdViewMy8Ds_Click
     

End Sub

This is the message that pops up:
PHP:
Syntax error (missing operator) in query '[EMailAddress]= myemailaddress'

Thanks,
 
Try something like this
Code:
Private Sub cmdViewMy8Ds_Click()
On Error GoTo Err_cmdViewMy8Ds_Click
      
   Dim strDocName As String
   Dim strLinkCriteria As String
   
   strDocName = "fMy8Ds"
   strLinkCriteria = "[EmailAddress] =" & Chr(34) & Forms![frmUserLogon].[txtUser] & Chr(34)

   
   Me.Visible = False
   DoCmd.OpenForm strDocName, , , strLinkCriteria

Exit_cmdViewMy8Ds_Click:
   Exit Sub

Err_cmdViewMy8Ds_Click:
   MsgBox Err.Description
   Resume Exit_cmdViewMy8Ds_Click
     

End Sub
You need to generate some thing like "[Emailadress] = "myemail@blah.blah"
 
Thanks Rabbie,

When I revised the code the form opens but there is no data.

I also tried using where qMy8Ds.EMailAddress = Forms![fUserLogon]![txtuser] the result is there are no results.
 
I tried using a filter on load of the form fMy8D's instead of using the command button to opening as a linked form. I used the following code

Code:
Me.Filter = Me.EmailAddress = " & Me.txtUser"
Me.FilterOn = True
Me.Refresh

The form opens up with no record. I was wondering if it is because on my logon I have used 2 concatenated fields to create the txtUser field. I am at a loss for what to try next.

Does anyone have a suggestion?

:)
 
This line is incorrect:
Code:
 strLinkCriteria = "[EmailAddress] =" & Forms![frmUserLogon].[txtUser]
It should be:
Code:
strLinkCriteria = "[EmailAddress]=[color=red]'[/color]" & Forms!frmUserLogon.txtUser & [color=red]"'[/color]"

needs quotes if text and you don't need the brackets.

If the code is actually ON Forms!frmUserLogin then you really only need:

Code:
strLinkCriteria = "[EmailAddress]=[color=red]'[/color]" & Me.txtUser & [color=red]"'[/color]"
 

Users who are viewing this thread

Back
Top Bottom