Help Please - Cascade/Requery

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.
 
G

Guest

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
 
G

Guest

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
 

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

Top