Results 1 to 8 of 8
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    Edit and Existing Form


    Hi All

    i have an Form called "Order" that has a subform called "OrdersDetails" in it.

    when i click a button called "Add Order" on the customers details page the "Orders" form opens and i can add the order for that customer, this form opens up with the properties of the form set to "Add Additions and Data entry" set to yes,this is working as expected.

    i also have an "Edit Order" form that is basically the same as the "Order" form but this form opens with "Allow Edit" set to yes, showing the details of the customers order, this is also working as expected.

    what i would like to do, but struggling with is this

    i would like the "Order" form to open up with "Add Additions and Data entry" set to yes when i click the Add Orders Button and then when i click the edit order button i would like the "Order" Form to open up with "Allow Edit" set to yes.

    this would allow me to reduce the amount of forms the database has

    any help would be great

    Steve

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I posted a sample DB that uses subforms to address this issue. The different forms you are discussing here can be placed into one sub form and the controls are all on the main form. I believe it would help you in your goal to minimize the number of forms used.

    https://www.accessforums.net/sample-...tml#post190509

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Itsme

    Many thanks for the heads up, i will take a look at that

    many thanks

    steve

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Let me know if it does not address your question or if, after reviewing it, it creates more questions.

  5. #5
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Itsme

    I Have a play with the database you gave me, but i have noticed that my forms are different.

    the database i am working with has been added to by lots of other people over the last few years, i did not notice that the "Add Orders" form is based from a table and the "Edit Orders" form is bound to a query.

    I have attached a copy of the database, what i am trying to do is, replace the add orders form with the edit orders form so that i can reduce the amount of forms and possible coding issues i may have in the database, there are currently well over 100 forms in the system but most of them are duplicated.

    the "add orders" form is bound to a the table "Orders" the "Add Orders Details" form is bound to the table "Orders Details"

    the "Edit Orders" form is based of a query this is visible in the "properties","Data","Record set" value of the form

    i would like to be able to click on the customer, then on the customer details form, click on the orders tab, when clicking the add order button i would like the form "edit orders" to open up with the customerID of the customer and allow the parts to be added, when closing the form and clicking the edit order button, the edit order form should open allowing me to edit the order using the same form.

    any help you can give would be great.

    many thanks

    steve
    Attached Files Attached Files

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    The sample DB I linked you to is only an example to some techniques. It is a simple DB. One thing it has which may be of interest is the ability to combine a form that you view records without a chance to edit data by mistake. When you want to edit data you click a control to allow this. When you want to transform the form to add a record the user can choose to do so.

    It is one form (actually two forms, a main and a subform) that has many functions. By combining the functions into one form, you have an opportunity to reduce the overall number of forms within your DB.

    Also, the form example offers a template to create additional forms with other recordsources. A good benefit to users that can familiarize themselves with a common interface.

    As I reread your original post, this example seems like a great benefit to you if you can successfully employ the techniques.

    You have a DB containing many objects within. Why don't you start by extracting a small section into a blank DB formatted as 2003. Isolate the task you describe here as Order Details and Edit Orders. Define what is needed for this task at hand to operate autonomously from your original DB in this new blank DB. As you work, document changes made and modify dates in the original DB. Avoiding macros for accomplishing your task is highly recommended.

    Isolating the task at hand will make it easier for you to manage and interpret, as well as for others who may offer assistance.

  7. #7
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Itsme

    Many thanks for getting back in touch

    i will get my head around your example, many thanks mate

    Steve

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I tried to build the example so you can use find/replace within the VBA editor to insert the names of your objects.

    You have already identified some of the object dependencies, i.e. tables and queries. It should be relatively simple to export them to a blank DB. As long as your table properties remain unchanged, it should be a snap to place your revised queries and forms back into your original DB.

    Post up when you make some progress and or have questions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  2. Cannot Edit Form
    By Derrick T. Davidson in forum Queries
    Replies: 7
    Last Post: 06-16-2013, 07:26 AM
  3. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  4. Replies: 11
    Last Post: 05-23-2012, 08:42 AM
  5. Replies: 1
    Last Post: 12-04-2011, 09:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums