Form Attached to Parameter Query - Cancel Query

S

Stuart

Hi All,

I've been trying to figure this out today with no success.

I'm working on a clients code that has forms attached to parameter queries.
I don't have a choice to change all their code to get the parameters before
calling the form, so I'm limited to no rewrites.

All I want to do is when the user clicks Cancel on the parameter query
prompt, to NOT display the empty form. Sounds easy enough. The only examples
I've seen is using the RecordsetClone property to check for "0", which isn't
even close to working. Don't know how the 10+ examples I've seen actually
work...

Thanks for any insight that may be provided.
 
F

fredg

Hi All,

I've been trying to figure this out today with no success.

I'm working on a clients code that has forms attached to parameter queries.
I don't have a choice to change all their code to get the parameters before
calling the form, so I'm limited to no rewrites.

All I want to do is when the user clicks Cancel on the parameter query
prompt, to NOT display the empty form. Sounds easy enough. The only examples
I've seen is using the RecordsetClone property to check for "0", which isn't
even close to working. Don't know how the 10+ examples I've seen actually
work...

Thanks for any insight that may be provided.

"Which isn't even close to working" doesn't tell us much.
I don't know why you didn't post the entire code, (did you really
check for "0") as the following in a form's Open event works just
fine for me.

If Me.RecordsetClone.RecordCount = 0 Then
Cancel = True
End If

Note the 0 (without quotes) is a number not text, as your above
question indicated.
 
S

Stuart

Hi fredg,

same code that you displayed...

Me.RecordsetClone.RecordCount <- has no value
-----------------------------------------------------------------
runtime error 7951

You entered an expression that has an invalid reference to the
recordsetclone property.
-----------------------------------------------------------------
 
S

Stuart

CLOSED.

Stuart said:
Hi fredg,

same code that you displayed...

Me.RecordsetClone.RecordCount <- has no value
-----------------------------------------------------------------
runtime error 7951

You entered an expression that has an invalid reference to the
recordsetclone property.
 

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