Data entry

J

JB

Hello
The database in question has a Menu where the user can choose several
options one of which is a form which displays his own data in a list. In
that form he can then choose the record he wants to work with which opens
the main form. ('Clients')
I'd like to add in the Menu a command to Add a new Client and have the
Client form open in New Record.
Changing the form property 'Data Entry' to Yes worked, but it it meant when
the user chooses the record he wants to work with it also opens in New
Record rather than the chosen one.

From seeing other databases that this works for I've done a procedure as
follows.

Private Sub New_Click()
Dim frm As Form
Me.Visible = False
DoCmd.OpenForm FormName:="frmClients", DataMode:=acAdd
Set frm = Forms!frmClients
frm.SetFocus
frm![ClientName].SetFocus
frm!cmdAddNew.Visible = True
frm!cmdSearch.Enabled = False
frm!cmdReports.Enabled = True

End Sub

But it's not working.
Can someone please help with this
Thanks
Jen
 
J

JB

Tried again and it did work. So very happy.
BUT it closes the menu once the Form opens. I can't work out how to keep the
Menu open like it does for all other commands it has.
Thank you
 
J

John W. Vinson

Tried again and it did work. So very happy.
BUT it closes the menu once the Form opens. I can't work out how to keep the
Menu open like it does for all other commands it has.
Thank you

Just remove the line Me.Visble = False. The form isn't closing, it's just
being hidden from view.
 

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