Open a form based on query contents

M

Mahmood

I have a form (FrmNewNotes) based on a query (QryNewNotes)which
determins if any new notes have been made since a user last vewied the
database. If there are new notes the query is populated otherwise it's
empty.

I would like to open frmNewNotes without any user input after the main
menu has loaded (perhaps on the OnActive event), but only if there are
new notes to be viewed.

Any suggestion/ideas on how to best do this.

My thanks in advance.

Ps I'm running access2K
 
D

Dirk Goldgar

Mahmood said:
I have a form (FrmNewNotes) based on a query (QryNewNotes)which
determins if any new notes have been made since a user last vewied the
database. If there are new notes the query is populated otherwise it's
empty.

I would like to open frmNewNotes without any user input after the main
menu has loaded (perhaps on the OnActive event), but only if there are
new notes to be viewed.

Any suggestion/ideas on how to best do this.

My thanks in advance.

Ps I'm running access2K

You might try just using DCount on the query to see if there are any
records, before opening the form:

If DCount("*", "QryNewNotes") > 0 Then
DoCmd.OpenForm "FrmNewNotes"
End If

If the query takes a long time to run, this might not be the best
solution, but otherwise it should get the job done.
 

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