Link to home
Start Free TrialLog in
Avatar of donvike1
donvike1Flag for United States of America

asked on

How to click on a listing of dates within a form/subform and have the form go to that date?

I have a form call ProgressNote which consist of a subform of 4 tab controls - works great.
On the ProgressNote form I have another subform called ServiceDates - the subform is pulling in the correct ServiceDate value.
I would like to be able to click on anyone of the ServiceDates in the subform and the ProgressNote form will go to that record for that date.  How do I do this.  I have included a screenshot of my form along with notes (data is fictitious).

I would greatly appreciate any help/instructions.

Thanks
ServiceDates-subform.docx
Avatar of ASP8MBM
ASP8MBM
Flag of Afghanistan image

Many ways, but I have done something similar recently:

1) The data source of your subform must be dependent on the on the ServiceDate value(include the date in the query or the SQL string)

2) have an event built for the ServiceDate (I am assuming it is a text control), and upong Clicking (Use Click_Event) you requery your subform(yourSubform.Requery)

You can also use filters....
Avatar of donvike1

ASKER

Ok, my data source for the subform is dependent on the ServiceDate value and I have an event.
My data is coming through just fine.
I would like to know how to click on the service date for the pt and the ProgressNote form reopens to that record for the date that was click.
ASKER CERTIFIED SOLUTION
Avatar of donvike1
donvike1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The other comments did not work for me as I did not understand, so I read up on all the events and controls and was able to resolve the issue.
Correction
I found the solution to the frm_ProgressNote form and DateOfService subform by doing the following:
Right Click on the DateOfService textbox control on the subform
Click properties - Event - 3 dots
You will see
Private Sub DateOfService_Click()
type the following just above End Sub and just below Private Sub
DoCmd.OpenForm "frm_ProgressNote", , , "[DateOfService]= #" & Me.DateOfService & "#"