Double Click event and loading a form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carol Siu
    New Member
    • Oct 2011
    • 1

    Double Click event and loading a form

    Hello, I wonder if anyone can help me. I am stuck on it for almost 3 weeks.

    I have a table "JobDatabas e" (which include all details of each job position), a dataentry form, a Search form. In my Search form, I had a list box and a combo box (include all departments), where staff can pull down the menu and choose the department to see the job positions within that department. Then, the result will show on the list box. Here is my VB for that step:
    Code:
    Private Sub combo0_Click()
    RefreshList
    End Sub
    Private sub RefreshList()
    Dim sql As String
    Dim selectedDeptID As Integer
    selectedDeptID = Me.Combo0.Value
    sql = "SELECt Jobdatabse.JobID, JobDatabase.JobPosition, JobDatabase.Dept FROM JobDatabase "_ & "WHERE JobDatabase.Dept = " & selectedDeptID _ & "ORDER BY JobDatabse.[JobPosition]"
    Me.List2.RowSource = sql
    End Sub
    It worked good!

    Now my next step is double click a selected item listed on the list box. If the staff double click one of the listed items, then a detail form (a form include all details of the selected jobposition) will pop out. I don't know what to do!!!!! Can anyone help me? Greatly appreciated.

    Carol.
    Last edited by Meetee; Oct 12 '11, 05:16 AM. Reason: code tags added
  • Narender Sagar
    New Member
    • Jul 2011
    • 189

    #2
    Hi Carol
    One of the method is as follows:
    1. you should have a 'Detail Form' in your database, having JobID as must field along with other fields.
    2. Then you can create macro under Event On Double Click with field "JobID" in your mail form.
    3. If Not IsNull([JobId]) Then
    OpenForm
    Form Name Your Detail Form name
    View Form
    Filter Name
    Where Condition = ="[JobID]=" &[JobID]
    Data Mode
    Window Mode Dialog
    EndIf
    Last edited by Narender Sagar; Oct 12 '11, 08:30 AM. Reason: Spelling correction and re-formatting

    Comment

    Working...