relationship with "environ" field

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

Guest

Table 1 has a field named [CurrentUserID] which defaults using environ.
Table 2 has a field named [PT UID]. The two fields are related.

Table 2 also has a [PT Name] field. I would like my query to show all three
of these fields. Currently, the [PT Name] field comes up blank. What am I
doing wrong? Table 2 has a [PT Name] for every [PT UID], so I would expect
to see the name.

Thanks in advance!
Mary
 
I would expect to see some SQL and possibly some code that retrieves the
"environ"...
 
Here's the SQL from my query:

SELECT [TaskAction].CurrentUserID, [TaskAction].TaskDate, [TaskAction].Task,
[TaskAction].[TimeSpent], [TaskAction].UserID, [TaskAction].EntryTime
FROM ChngTeam INNER JOIN [TaskAction] ON ChngTeam.[CTUID] =
[TaskAction].CurrentUserID
WITH OWNERACCESS OPTION;

[TaskAction].CurrentUserID is retrieved using the following:

=Environ$("UserName")

The [ChngTeam].CTUID field and the [TaskAction].CurrentUserID field are both
text fields limited to 6 characters.


Duane Hookom said:
I would expect to see some SQL and possibly some code that retrieves the
"environ"...

--
Duane Hookom
MS Access MVP


Mary said:
Table 1 has a field named [CurrentUserID] which defaults using environ.
Table 2 has a field named [PT UID]. The two fields are related.

Table 2 also has a [PT Name] field. I would like my query to show all
three
of these fields. Currently, the [PT Name] field comes up blank. What am
I
doing wrong? Table 2 has a [PT Name] for every [PT UID], so I would
expect
to see the name.

Thanks in advance!
Mary
 
I've also tried this alternate method of updating my TaskAction table:

On a form, I update the [TaskAction].CurrentUserID control with a default
value of CurrentUser(). I update the [TaskAction].UserID control with a
default value of fOSUsername(). I am getting the correct results, but still
cannot link either of these ID fields with my user table CTUID field in a
query.

Thanks, Mary
 
CurrentUser() is not the same as the Windows Network login returned by
fOSUserName(). I recommend never using the Environ() function.

--
Duane Hookom
MS Access MVP


Mary said:
I've also tried this alternate method of updating my TaskAction table:

On a form, I update the [TaskAction].CurrentUserID control with a default
value of CurrentUser(). I update the [TaskAction].UserID control with a
default value of fOSUsername(). I am getting the correct results, but
still
cannot link either of these ID fields with my user table CTUID field in a
query.

Thanks, Mary

Mary said:
Table 1 has a field named [CurrentUserID] which defaults using environ.
Table 2 has a field named [PT UID]. The two fields are related.

Table 2 also has a [PT Name] field. I would like my query to show all
three
of these fields. Currently, the [PT Name] field comes up blank. What am
I
doing wrong? Table 2 has a [PT Name] for every [PT UID], so I would
expect
to see the name.

Thanks in advance!
Mary
 

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