CmdButton to open form in edit mode

  • Thread starter Thread starter Sondra
  • Start date Start date
S

Sondra

I have a form that I have created that the data source is
a query from the master table. I want to add a button on
the form that opens the form in edit mode and running the
query. Can someone help me write the OnClick
[eventprocedure] for this?

Thanks in advance.
 
Sondra said:
I have a form that I have created that the data source is
a query from the master table. I want to add a button on
the form that opens the form in edit mode and running the
query. Can someone help me write the OnClick
[eventprocedure] for this?


Use the command button wizard to write the code for you.
You don't have to worry about edit mode as that's the
default.
 
Use the command button wizard to write the code for you.
You don't have to worry about edit mode as that's the
default.
I've done that; however it opens up the query and not the
form. I want to reopen the form and have the query ask
for the specific criteria. I was going to writ a macro
to close the form and reopen it in edit mode; but I want
to avoid macros if at all possible.

Thanks.
 
I've done that; however it opens up the query and not the
form. I want to reopen the form and have the query ask
for the specific criteria. I was going to writ a macro
to close the form and reopen it in edit mode; but I want
to avoid macros if at all possible.


No macros is good ;-)

Are you trying to open the same form that has the button??

If so, since OpenForm can only deal with a single instance
of a database object, you're going to have to bend over
backwards to make that happen. Let's try having the command
button just set the form's AllowEdits property to True.
Me.AllowEdits = True
 
Back
Top