How to know the form whether bound to a recordset at runtime

T

TC

Ken says Me.Recordsource is a string, Mike says it's a variant!

So do it like this, then it does not matter either way:

if nz (me.recordsource, "") = "" then msgbox "no recordsource"

HTH,
TC
 
T

tao lin

Hi,

I am use Access 2000 and winXP pro. I try to use IsNull(Me.RecordSet) to
check wether the form is bound to a recordset or not. But it always return
False. Could anyone tell me how can I know the form is bound to a recordset
at runtime?

Cheers,

Tao
 
K

Ken Snell

Check the RecordSource property. If it's equal to an empty string, then the
form is unbound:

If Me.RecordSource = "" Then
' form is unbound
Else
' form is bound
End If
 
T

tao lin

Thank you for all of suggestion. All of them are working fine under my
access 2000.
 
B

Bruce M. Thompson

Ken says Me.Recordsource is a string, Mike says it's a variant!

It is a string.
 

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