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
 

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