using form to get parameters

J

Jen

Hi Paul,

The code for your control doesn't seem right to me:

Private Sub Search_Click()
On Error GoTo Err_Search_Click

Dim stDocName As String

stDocName = "Enquiry-Complaint Query by Selected
Department with Date"
DoCmd.OpenReport stDocName, acPreview

Me.Visible = False

'DoCmd.OpenForm "QuerySelect", acDialog
'*** isn't this form already open? *******
'*** it's probably opening up the form and the text boxes
are null, that's why you're not retrieving records **

DoCmd.Close acForm, Me.Name
'*** this is an alternative to hard-coding the name in the
form name argument.

The rest of the routine looks fine.

Regards,
Jen
 
Top