Tupacmoche
Registered User.
- Local time
- Today, 11:21
- Joined
- Apr 28, 2008
- Messages
- 291
Hi Form Masters,
I have a combo box that displays 5 columns. It is populated by a userid field that filters the number of rows none, one or more. Functioning in the usual way when you click on the down arrow of the combo box it will show the rows associated with the userid. Now, to the issue. I have added a procedure to double click event. It displays a msgbox with information about the matching row. Please see attached file. What, I want to do when there are more than one is have the ability to scroll through the list of records and select the one I want. This is essentially the same functionality that is provided by the combo box. But, the display is different. Any ideas how this can be done? Here is the code for the data, I just don't know how to display it as described.
:banghead:
Private Sub ProposalNum_DblClick(Cancel As Integer)
Dim MsgStr1 As String
Dim MsgStr2 As String
Dim MsgStr3 As String
Dim MsgStr4 As String
Dim MsgStr5 As String
MsgStr1 = Nz(DLookup("Proposal_id", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr2 = Nz(DLookup("Proposal_Title", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr3 = Nz(DLookup("Target_Amt", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr4 = Nz(DLookup("Start_Date", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr5 = Nz(DLookup("Staff_Report_Name", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgBox ("Proposal Number: " & MsgStr1 & vbCrLf & "Proposal Title: " & MsgStr2 & vbCrLf & "Target_Amt: " & Format(MsgStr3, "Currency") _
& vbCrLf & "Start Date: " & MsgStr4 & vbCrLf & "Staff Responsible: " & MsgStr5)
End Sub
I have a combo box that displays 5 columns. It is populated by a userid field that filters the number of rows none, one or more. Functioning in the usual way when you click on the down arrow of the combo box it will show the rows associated with the userid. Now, to the issue. I have added a procedure to double click event. It displays a msgbox with information about the matching row. Please see attached file. What, I want to do when there are more than one is have the ability to scroll through the list of records and select the one I want. This is essentially the same functionality that is provided by the combo box. But, the display is different. Any ideas how this can be done? Here is the code for the data, I just don't know how to display it as described.

Private Sub ProposalNum_DblClick(Cancel As Integer)
Dim MsgStr1 As String
Dim MsgStr2 As String
Dim MsgStr3 As String
Dim MsgStr4 As String
Dim MsgStr5 As String
MsgStr1 = Nz(DLookup("Proposal_id", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr2 = Nz(DLookup("Proposal_Title", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr3 = Nz(DLookup("Target_Amt", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr4 = Nz(DLookup("Start_Date", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgStr5 = Nz(DLookup("Staff_Report_Name", "dbo_dm_proposal", "id_Number= '" & [Forms]![Donor_Intake_Form]![DonorAdvanceID] & "' and Proposal_Is_Active = '" & "Y" & " '"))
MsgBox ("Proposal Number: " & MsgStr1 & vbCrLf & "Proposal Title: " & MsgStr2 & vbCrLf & "Target_Amt: " & Format(MsgStr3, "Currency") _
& vbCrLf & "Start Date: " & MsgStr4 & vbCrLf & "Staff Responsible: " & MsgStr5)
End Sub