TommyB
06-07-2007, 10:52 AM
I've searched through the forums, but have been unable to find help with the syntax for a SELECT statement I have in a Form.
The following general module stores info about a user that logs into the database:
Public Type UserInfo
ViewID As Integer
AccessID As Integer
Active As Boolean
Password As String
UserID As String
UserName As String
SecurityID As String
End Type
Public User As UserInfo
I have a SELECT query in the Record Source of a form that I want to set a condition on the UserID variable. Here is my SQL:
SELECT tblCurrentMonthData.BU, tblCurrentMonthData.Obj, tblCurrentMonthData.Sub, tblCurrentMonthData.Balance
FROM tblCurrentMonthData
WHERE tblCurrentMonthData.PreparerID = User.UserID;
When I try to open the form, I get a dialog box that asks for the parameter User.UserID
I am sure there is some problem with my syntax, I just can't figure in out.
Thanks in advance for any help!!
The following general module stores info about a user that logs into the database:
Public Type UserInfo
ViewID As Integer
AccessID As Integer
Active As Boolean
Password As String
UserID As String
UserName As String
SecurityID As String
End Type
Public User As UserInfo
I have a SELECT query in the Record Source of a form that I want to set a condition on the UserID variable. Here is my SQL:
SELECT tblCurrentMonthData.BU, tblCurrentMonthData.Obj, tblCurrentMonthData.Sub, tblCurrentMonthData.Balance
FROM tblCurrentMonthData
WHERE tblCurrentMonthData.PreparerID = User.UserID;
When I try to open the form, I get a dialog box that asks for the parameter User.UserID
I am sure there is some problem with my syntax, I just can't figure in out.
Thanks in advance for any help!!