FORMS: having a blank form shown when opening form

N

NurseHHPMS

I have created a school nursing database for 32 schools. I have a main menu
and a form with a lookup box for student names. I have a form and a sub
form. When I open the form from the Main Menu there is previous data in the
subform showing without having chosen a student from the lookup box. If I
choose a student from the lookup box the form is correct.

How do I have a blank form and subform showing when the form is first
opened? Is this something with a default setting?
 
A

Al Campagna

NurseHHPMS
In the code behind the button Click event...
Private Sub cmdOpenMyForm_Click()
DoCmd.OpenForm "frmMyForm"
DoCmd.GoToRecord , , acNewRec
End Sub

OR... a macro that uses the OpenForm and GoToRecord actions.

That will open the recordset at a New (blank) record.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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