I have this form "frmJobDaily" The structure I am able to select a customer, then below, a job address. To the right shows and dates where an entry has been made for the selected job address.
The drop down date field above the dates shown, I use to select a date and it will populate the controls to the right which show the details per date selected, and if nothing is on record it will be empty in which I enter new data for the employee hours and material used as well as a description for the selected date.
All works great, I have been able to call a report and send an invoice using the data entered, then making queries based upon the tables affected.
Now, the table control showing existing dates for the job is just that, for show. I use that and then select a date from the date drop down to get the details.
What I want is to dbl click on the table control and pass that to the date drop down. With searching through I have found the solution to get the cell value (thanx to the wise ones on this forum) but have yet to get past that point.
Code: Select all
Sub DoubleClick (oEV as object) 'Called by double click on table control
' wait 300
if oEV.clickcount <> 2 then Exit Sub 'Aborts if not double click
GetSecondColumn(oEV) 'calls Subroutine to get other fields/columns
End sub
Sub GetSecondColumn (oEV as object) 'Called by last line Sub ContactName()
'oMainForm = thisComponent.Parent.FormDocuments
oMainForm = thisComponent.Parent.FormDocuments
'oMainForm = oMainForm.getByName("frmJobDaily").getByName("Jobs").getByName("Filter Form")
oForm = oEV.Source.Model.Parent
o2Col = oForm.Columns.GetByName("Date")
msgbox "Linked text is '" & o2Col.String & "'"
msgbox oForm.Name
if oMainForm.HasByName("frmJobDaily") then
oMainForm = OMainForm.getByName("frmJobDaily")
'oMainForm = OMainForm.getByName("Customers")
'oMainform = oMainForm.thisComponent.DrawPage.Forms.getByName("frmJobDaily")
msgbox oMainForm.Name
end if
End Sub
The macro works as far as giving me the msg boxes (helps me see what I am getting), but I get errors when I uncomment
Code: Select all
'oMainForm = OMainForm.getByName("Customers")
'oMainform = oMainForm.thisComponent.DrawPage.Forms.getByName("frmJobDaily")
