Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    6

    Question Unanswered: filter subform with combox issue (record being updated)

    i have a Table with following fields:

    [Work_Table]
    Ref_id
    Date
    Employee_Nr
    Actual_Shift



    [frm_Mainform]

    in the mainform i have a combobox named [cboDate], ive added the following SQL line in ROW SOURCE
    Code:
    SELECT DISTINCT DATE FROM WORK_TABLE;
    - when a Date is selected in combobox, and the button "SHOW" is clicked, in subform will show only the records with corresponding Date.


    This works as intended, but the problem i have is when i select another Date in combobox and press Show, the DATE in the first record in the subform is UPDATED with the selected Date in combobox. What is wrong here? i Don't get it, i've spends days and days and looked on internet for examples but still not succeeded. Anybody know what ive done wrong here?

    Additional info:

    [frm_Subform]
    in the property of the subform i ve added into ROW SOURCE the following code:
    Code:
    SELECT Work_Table.Ref_Nr, Work_Table.Date, Work_Table.Employee_Nr, Work_Table.Actual_Shift FROM Work_Table;
    The textboxes in the subform are updated by this select statement.


    - Subform is linked to Mainform on [DATE] (parent/child link)
    - Mainform = singleform
    - Subform = continious form


    --- code behind button "Show" ---

    Code:
    Private Sub cmdShow_Click()
     
    On Error GoTo Err_cmdShow_Click
     
     Me.Refresh
      
    Exit_cmdShow_Click:
        Exit Sub
    
    Err_cmdShow_Click:
        MsgBox Err.Description
        Resume Exit_cmdShow_Click
    
    
    End Sub
    ----------

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Sounds like you want to remove the control source from the combo; it will say unbound when viewed in design view.
    Paul

  3. #3
    Join Date
    Dec 2008
    Posts
    6
    thnx for the help Pbaldy, i thought about your idea and i decided to unbound my combobox and put a parameter into my query that is connected to my combobox. and some little changes here and there and now it works as intended. thnx for pointing to the right direction

Posting Permissions

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