Open new record form from another form

C

Crispywafers

Hi all,

This seems like it would be fairly simple, but quite frankly I can't
figure it out. I have combed through other posts and still can't get
it working.

I have two tables (Students, Emergency Contacts) and two seperate main
entry forms for each table (frmNewStudent & frmEmergencyContacts). I
wanted to put a command button on frmNewStudent that when clicked
would open up frmEmergencyContacts to an add new record so that a user
can add a completly new emergency contact record to the Emergency
contact table.

I hope that makes sense.

I haven't been able to get it working. Code I'm currently using is
spitting back the error "Action or method requires a Form Name
argument". Code I have used previously has simply taken me to the
first record in the EmergencyContacts recordset. I just want the form
to ADD a record to EmergencyContacts table.

Code in use:

Private Sub Command76_Click()

On Error GoTo Err_Command76_Click

DoCmd.OpenForm frmEmergencyContacts

DoCmd.GoToRecord , , acNewRec

Exit_Command76_Click:
Exit Sub

Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click

End Sub
 
G

Gerald Stanley

Try
DoCmd.OpenForm "frmEmergencyContacts"

Hope This Helps
Gerald Stanley MCSD
 

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