Hi Forum,
I have created a form with code etc that will produce letters and update tables accordingly.
One pce of data I can not get correct is the User ID.
When we log on we use our password against a login script - see jpg below.
TBLTeamMembers has fields TeamID (Initials per logon script), firstname, lastname etc.
I want to get the Intials (TeamID) to be used in one of the Append tasks being performed.
What ever I try, it always sends an error message where I can type in the initials and all is fine.
But I don't want to type my initials 700 times
Here is the sql that does the appending
The error message appears and I type my Initials and all works fine with my initilas UpperCase as per the Dim here
This means the system picks up that strUserID should be Uppercase but it doesn't pickup that it should be CurrentUser.
Any suggestions of how to resolve this??
Thanks
I have created a form with code etc that will produce letters and update tables accordingly.
One pce of data I can not get correct is the User ID.
When we log on we use our password against a login script - see jpg below.
TBLTeamMembers has fields TeamID (Initials per logon script), firstname, lastname etc.
I want to get the Intials (TeamID) to be used in one of the Append tasks being performed.
What ever I try, it always sends an error message where I can type in the initials and all is fine.
But I don't want to type my initials 700 times

Here is the sql that does the appending
Code:
sqlString = "INSERT INTO tblLoanComm ( LoanID, CommNotes, Operator, CommDate, CommTime ) " & _
"SELECT TBLLOAN.LDPK, ""Sent "" & [TblLetterOptions].[LetterType] & "" Letter"" AS CommNotes, TBLTeamMembers.TeamID, Date() AS CommDate, Time() AS CommTime " & _
"FROM TBLLOAN, TblLetterOptions, TBLTeamMembers " & _
"WHERE (((TBLLOAN.LDPK)=" & LDPK & ") AND ((TBLTeamMembers.TeamID)=" & strUserID & ") AND ((TblLetterOptions.LetterID)=" & LetterID & "));"
The error message appears and I type my Initials and all works fine with my initilas UpperCase as per the Dim here
Code:
Dim sqlString, strUserID As String
Dim ADPK, LDPK, LetterID As Integer
ADPK = Me.ADPK
LDPK = Me.LDPK
LetterID = Me.LetterID
strUserID = UCase(CurrentUser)
Any suggestions of how to resolve this??
Thanks
