Create Command Button to Open a Form run from a Query

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

Sondra

I want to create a command button on a form that allows
the user to edit additional entries from another record.

My form is created on a query that has a criteria asking
the user to enter the DocumentNumber and VersionNumber.

How do I write my code to make it so the form open again
by asking the same query questions?

Thanks in Advance.
 
I don't think I posted my question correctly.

I have a query which asks a user:

[Enter Document Number]
[Enter Version Number]

I create a form from the query which opens up the
information from the data entered by the user from the
aforementioned questions.

When the user has made all the changes to the form. There
may be the necessity to open another record from the
query.

Therefore, I want to create an "Update Another Record"
button on the form.

=====Close the current record
=====Run the query again asking the same two questions
=====Reopen the form for the new answer to the questions

I hope that gives better thought to my question.

Thanks again.
 
Sondra, try putting this code in a button on your form:

DoCmd.GoToRecord , , acNewRec
DoCmd.RunCommand acCmdRemoveFilterSort

Hope this helps.


I don't think I posted my question correctly.

I have a query which asks a user:

[Enter Document Number]
[Enter Version Number]

I create a form from the query which opens up the
information from the data entered by the user from the
aforementioned questions.

When the user has made all the changes to the form. There
may be the necessity to open another record from the
query.

Therefore, I want to create an "Update Another Record"
button on the form.

=====Close the current record
=====Run the query again asking the same two questions
=====Reopen the form for the new answer to the questions

I hope that gives better thought to my question.

Thanks again.
-----Original Message-----
Try adding this code:

DoCmd.RunCommand acCmdRemoveFilterSort




.
 
Back
Top