Help Please - Cascade/Requery

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

Guest

I've searched this newsgroup and still need your help.

I have a form with a control for the CurrentUser. The CurrentUserID matches
the UserID in my TeamTable. There is a UserName field in my TeamTable. I
would like the UserName field to update automatically on my form based on the
CurrentUser.

CurrentUser ID = X (This fills in automatically based on User log on)
UserName = Y (This should autofill after the CurrentUser updates, can't get
it to work right)

Thanks in advance.
 
Mary,
I think in order to do that, you might need to do the followings:
1) have a variable to store your CurrentUserID, e.g. giUserID.
2) create a function that is similar to this.
function GetUserID() as integer
GetUserID = giUserID
end sub

3) Modify your Query to something like this:
SELECT USERID, USERNAME FROM TEAMTABLE WHERE USERID.TEAMTABLE =GETUSERID

4) requery
 
Thanks, Jeff, that worked.

Jeff said:
Mary,
I think in order to do that, you might need to do the followings:
1) have a variable to store your CurrentUserID, e.g. giUserID.
2) create a function that is similar to this.
function GetUserID() as integer
GetUserID = giUserID
end sub

3) Modify your Query to something like this:
SELECT USERID, USERNAME FROM TEAMTABLE WHERE USERID.TEAMTABLE =GETUSERID

4) requery
 
Back
Top