none
Pop-up form with split screen RRS feed

  • Question

  • I have a pop-up form to get a parameter for a report, but I need to show the user what are valid requests based on what is in the table. For example, if I had a report that gave all the detail for a single customer, I want the user to be able to enter the customer number when all they know is the customer name. That customer number then feeds a query. So I display a split form with customer number and customer name so they can scroll through the split screen and then enter the appropriate customer number. I don't want them to enter the customer name because there is too high a chance they will misspell it.

    The problem is that as soon as I add the split screen to the pop-up form, the pop-up takes up the whole screen. Any way around this? Or is there a better way to accomplish the same thing?

    Thanks for help.

    Merrikay


    • Edited by Merrikay Monday, March 5, 2018 9:54 PM
    Monday, March 5, 2018 9:53 PM

Answers

  • You are introducing unnecessary complications.  All you need is a dialogue form with two synchronized combo boxes, one, cboCustomerNumbers, which lists the customer number, the other, cboCustomerNames, which lists the customer names, but whose BoundColumn is a hidden customer number column.

    The first combo box's RowSource property would be:

    SELECT CustomerNumber
    FROM Customers
    ORDER BY CustomerNumber;

    The second  combo box's RowSource property would be:

    SELECT CustomerNumber, CustomerName
    FROM Customers
    ORDER BY CustomerName;

    The BoundColumn property of each would be 1, but the second would have a ColumnCount property of 2, and a ColumnWidths property of 0 to hide the first column.

    In the AfterUpdate event procedure of the first assign the selected customer to the second with:

        Me.cboCustomerNames = Me.cboCustomerNumbers

    and in the AfterUpdate event procedure of the second assign the selected customer to the first with:

        Me.cboCustomerNumbers = Me.cboCustomerNames

    As the customer number is the value of both controls either could be referenced  as a parameter in the report's query.  The user can select a customer either by name of by number.  Whichever they use, the other will immediately show the same customer's name or number.

    Ken Sheridan, Stafford, England

    • Marked as answer by Merrikay Tuesday, March 6, 2018 7:42 PM
    Tuesday, March 6, 2018 12:06 AM

All replies

  • Hi,

    Not sure if it's a better way but you can either,

    1. Use a Combobox for the user to select from the valid choices, or

    2. Use a Listbox for the same purpose.

    ...in your popup form.

    Just my 2 cents...

    Monday, March 5, 2018 10:06 PM
  • Thanks for the suggestion. My first choice for this was a combo box showing two columns, customer number and name. I named the control Sel_Cust, but when it went into the query, I got a type mismatch mistake.
    Monday, March 5, 2018 10:10 PM
  • Can you post the SQL statement you used? Maybe we can fix the error.
    Monday, March 5, 2018 10:11 PM
  • Well, I've moved on since then... have it coded with the split screen. Ok if I get back with you after exploring this solution? You don't have any suggestions for controlling the size of the split screen pop-up?

    Thanks,

    Merrikay


    Monday, March 5, 2018 10:41 PM
  • You could try using the MoveSize method to see if you can set the size of the Split Form.

    Hope it helps...

    Monday, March 5, 2018 10:42 PM
  • You are introducing unnecessary complications.  All you need is a dialogue form with two synchronized combo boxes, one, cboCustomerNumbers, which lists the customer number, the other, cboCustomerNames, which lists the customer names, but whose BoundColumn is a hidden customer number column.

    The first combo box's RowSource property would be:

    SELECT CustomerNumber
    FROM Customers
    ORDER BY CustomerNumber;

    The second  combo box's RowSource property would be:

    SELECT CustomerNumber, CustomerName
    FROM Customers
    ORDER BY CustomerName;

    The BoundColumn property of each would be 1, but the second would have a ColumnCount property of 2, and a ColumnWidths property of 0 to hide the first column.

    In the AfterUpdate event procedure of the first assign the selected customer to the second with:

        Me.cboCustomerNames = Me.cboCustomerNumbers

    and in the AfterUpdate event procedure of the second assign the selected customer to the first with:

        Me.cboCustomerNumbers = Me.cboCustomerNames

    As the customer number is the value of both controls either could be referenced  as a parameter in the report's query.  The user can select a customer either by name of by number.  Whichever they use, the other will immediately show the same customer's name or number.

    Ken Sheridan, Stafford, England

    • Marked as answer by Merrikay Tuesday, March 6, 2018 7:42 PM
    Tuesday, March 6, 2018 12:06 AM
  • Thanks, Ken. That works!!
    Tuesday, March 6, 2018 7:42 PM