Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    23

    Form Load Check

    Hey everyone. I am currently working on editing an input form. Initially, I had one form with three tabs. Each tab was used to input information on a different type item. For some of the items, the value was selected from a dropdown box. Because this restricts the user to only selected certain values, I added an "Add" form to each of these boes. This form will open, allow the user to enter the new value into the drop down box, and then requery the drop down box on the input form.



    In the long run I found that I had to many controls, so I broke these tabs into three seperate forms. The problem I am facing now is that the add forms don't want to work across all three forms. An example of what it looks like is this:

    Forms![Product Type 1]!Combo1.Requery
    Forms![Product Type 2]!Combo1.Requery
    Forms![Product Type 3]!Combo1.Requery

    So say I have form "Product Type 1" loaded and want to add a value to combo box 1. Upon doing so I will get the error that it cant find Combo1 on the two forms "Product Type 2" and "Product Type 3"

    What would the proper context look like to do something like the following:

    If Forms![Product Type 1] IsOpen Then
    Forms![Product Type 1]!Combo1.Requery

    Else If Forms![Product Type 2] IsOpen Then
    Forms![Product Type 2]!Combo1.Requery

    Else If Forms![Product Type 3] IsOpen Then
    Forms![Product Type 3]!Combo1.Requery

    End If

    I am uncertain as to what to place in the slot above that I have labeled "IsOpen".

    Thanks for any help in advance

  2. #2
    Join Date
    Jan 2011
    Posts
    13
    do the three combo boxes on the three different forms get the data from the same table?
    when a user adds a value to the "combo box" is it placed in the same table that the other combo boxes use?

  3. #3
    Join Date
    Aug 2010
    Posts
    23
    Yep, they all gather their information from the same table. It's just that after the user hits the "Add" button, I would like the appropriate form to requery to show that value in the drop down list. The problem being that since the same add forms are used accross three different forms, the program crashes due to the fact that it is unable to open the other two forms that are not open. I would like to add a series of If, Then statements to fix this.

  4. #4
    Join Date
    Aug 2010
    Posts
    23
    I was actually able to figure it out. It worked using the code:

    If CurrentProject.AllForms("frmMyForm").IsLoaded Then

    Thanks guys

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

Similar Threads

  1. Instant load of a form
    By carstenhdk in forum Forms
    Replies: 2
    Last Post: 05-06-2010, 12:27 AM
  2. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM
  3. Load Record from report in form
    By rdirosato in forum Reports
    Replies: 13
    Last Post: 03-08-2010, 10:35 PM
  4. Change the text box color on form load
    By mikec in forum Programming
    Replies: 2
    Last Post: 03-01-2010, 11:47 PM
  5. On Load, form not visible
    By Bruce in forum Forms
    Replies: 15
    Last Post: 02-24-2010, 04:06 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