I have a form that the user can enter a date and I want this data to appear on the report, but the text control keeps coming up blank.
Private Sub lblCreateReport_Click()
'Weekly project update report primiarily used by management to
'track what is going on
Dim strUserID As String
Dim dteStartDate As Date
Dim strType As String
'Need to check is user is a manager as they are the only ones allowed to run report
strUserID = VBUserName()
strType = DLookup("Type", "tblBOTHTeamMEmbers", "UserID = '" & strUserID & "' ")
dteStartDate = Me.txtStartDate
If strType = "MGR" Then
DoCmd.OpenReport "rptProjects_Updates", acPreview
Reports!rptProjects_Updates.txtStartDate = dteStartDate
DoCmd.Close acForm, Me.name
MsgBox "You do not have permissions to run this report", vbOKOnly, "PERMISSION DENIED"