Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prepopulating a continuous form (A2002)

    I've created an Hours of Operation form that includes Day, OpenTime, CloseTime. The Day control is a combo box that includes the days of the week. I'd like to prepopulate the that control so that when the continous form opens the user already has 7 records, M-Su, and all they have to do is input the open and close times.

    The only way I've done anything like this in the past was to have prepopulate the form, allow the user to modify the records contents, and used a check box to determine which records to "save". Then saved those modified records to a new table with a make table query, used an append query to add those records "master" table, and finished up by an update query to restore the prepopulated form to it's original condition.

    I'm guessing there might be an easier way. Any suggestions?

    After the user has entered open and close times, the form calculates the hours of operation, I need to pull the results of calculations on that form to an unbound control on the main form. I only want the Hours of Operation form to open if there is currently no value in the control on the main form. Likewise, I only want to pull the calculated value into the control if there is no current value in that control on the main form.

    I had intended to have the control on the main form use the Got Focus event to identify if the control was Null and then open the Hours of Operation if it was. Then use the closing of the Hours of Operation form to trigger the "push" of the value to the main form. However, all of this is problematic if I use the above strategy to prepopulate the controls. There has got to be a better approach. I would really appreciate the insights of someone more experienced than I am.

    Elizabeth

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Prepopulating a continuous form (A2002)

    I don't understand why you need the intermediate step of a make table query. You should be able to append the records to the master table directly.

    Why do you want the hours of operation in an unbound control? If you use a calculated control, you will always be sure that the result is up-to-date.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prepopulating a continuous form (A2002)

    Must be having brain farts. There is indeed no need to take that extra step of a make table query and no need to perform the calculations on the Hours of Operation form and move the results to the main form.

    If I put the calculated control on the main form instead, would I need to either make sure the Hour of Operation form is open (and updated if necessary) prior to the calculated control getting the focus or perhaps make the Hours of Operation a subform? If so, is one preferable to the other from your view point?

    Eli

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Prepopulating a continuous form (A2002)

    I don't know enough about the situation to give a definitive answer. Hours of Operation as a subform on the main form is certainly a possibility. Alternatively, you can create a query that calculates the total, and use DLookup to display a value from this query on your main form.

  5. #5
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prepopulating a continuous form (A2002)

    Is one faster than the other? This main form will eventually end up as one of 5 "pages" on a tabbed form and each of these pages will have several subforms. I'm unsure how much that is going to impact performance.

    Elizabeth

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Prepopulating a continuous form (A2002)

    You'd have to test it on your data and configuration, it's hard to say. Multiple subforms can slow down performance, but DLookup isn't very fast either, so it probably depends on your exact situation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •