I am creating a dashboard and would like to put an event in the "On Dbl Click" that will open up the details to a second form. The second form is unbound with a combo box used as a filter to a subform.
The first form is subfrmInvoiceDB with the fields built from a query:
Contract_Number- Text
Invoice_No- Text
Invoice_Date- Date
Form to open up to is frmInvoices (Unbound):
cboContractNo (Contract_Number Column 1 and Contract_Data_ID column 2) bound column is 2 with the following code:
Private Sub cboJAANo_AfterUpdate()
Dim sql As String, Fieldname As String, FieldValue As String
Fieldname = "Contract_Number="
FieldValue = cboContractNo.Value
sql = Fieldname & Chr(34) & FieldValue & Chr(34)
Forms!frmInvoices.Filter = sql
Forms!frmInvoices.FilterOn = False
End Sub
I have tried modifing the code at baldyweb but am not having any luck. I also looked at code for the OpenArgs with no luck. Am new to VBA and think I missing something easy.
Dim rs As Object
Dim lngBookmark As Long
'set a variable to the current record
lngBookmark = Me.txtEmpID
'open the new form
DoCmd.OpenForm "frmEmployeesDetail"
'take it to the selected record
Set rs = Forms!frmEmployeesDetail.RecordsetClone
rs.FindFirst "EmpID = " & lngBookmark
Forms!frmEmployeesDetail.Bookmark = rs.Bookmark
Set rs = Nothing
Thanks, Anything would be helpful. Using Access 2010
The first form is subfrmInvoiceDB with the fields built from a query:
Contract_Number- Text
Invoice_No- Text
Invoice_Date- Date
Form to open up to is frmInvoices (Unbound):
cboContractNo (Contract_Number Column 1 and Contract_Data_ID column 2) bound column is 2 with the following code:
Private Sub cboJAANo_AfterUpdate()
Dim sql As String, Fieldname As String, FieldValue As String
Fieldname = "Contract_Number="
FieldValue = cboContractNo.Value
sql = Fieldname & Chr(34) & FieldValue & Chr(34)
Forms!frmInvoices.Filter = sql
Forms!frmInvoices.FilterOn = False
End Sub
I have tried modifing the code at baldyweb but am not having any luck. I also looked at code for the OpenArgs with no luck. Am new to VBA and think I missing something easy.
Dim rs As Object
Dim lngBookmark As Long
'set a variable to the current record
lngBookmark = Me.txtEmpID
'open the new form
DoCmd.OpenForm "frmEmployeesDetail"
'take it to the selected record
Set rs = Forms!frmEmployeesDetail.RecordsetClone
rs.FindFirst "EmpID = " & lngBookmark
Forms!frmEmployeesDetail.Bookmark = rs.Bookmark
Set rs = Nothing
Thanks, Anything would be helpful. Using Access 2010