W
Wissam
Hi,
I would greatly appreciate any help with the following,as I have been
stuggling for the past 3 days to get it done without succces. I am trying to
apply a filter on a form based on a subform field control value that equals
to a that in a control box on another form.
Description:
I have an access database which has the following:
-"tblPatients" : has a Primary key field called [Pt-ID] + other fields like
[Pt-name], [Pt-race],..
-"tblAppointments": has a primary key field called [App-tNumber] (random
auto number), a field called [Pt-ID], and other field such as [Appt-Date]
(for date of appointment; format is short date) and [Appt-Result],...
There is a one-many relationship between "tblPatients" and "tblAppointments"
based on [Pt-ID].
I have a form called "frmChart" (recordsource="tblPatients"; has controls
for fields like [Pt-ID],[Pt-name],...); in it there is a subform called
"sfrmAppointments" (recordsource= "tblAppointments"; has controls for fields
like [Appt-Date]).
I have a "mainswitch" form with a control box called [cboDate].
I want to do be able to do the following:
Enter a date in the [cboDate] box, and then through a click of a command
button called "filterfrmCharts" on the "mainswitch" form get the following:
Open "frmChart"
Apply a filter based on : sfrmAppointments.[Appt-Date] = [cboDate] value.
I am relatively new to access, and any details on the VBA code would be
greatly appreciated.
Thank you very much for your help.
I would greatly appreciate any help with the following,as I have been
stuggling for the past 3 days to get it done without succces. I am trying to
apply a filter on a form based on a subform field control value that equals
to a that in a control box on another form.
Description:
I have an access database which has the following:
-"tblPatients" : has a Primary key field called [Pt-ID] + other fields like
[Pt-name], [Pt-race],..
-"tblAppointments": has a primary key field called [App-tNumber] (random
auto number), a field called [Pt-ID], and other field such as [Appt-Date]
(for date of appointment; format is short date) and [Appt-Result],...
There is a one-many relationship between "tblPatients" and "tblAppointments"
based on [Pt-ID].
I have a form called "frmChart" (recordsource="tblPatients"; has controls
for fields like [Pt-ID],[Pt-name],...); in it there is a subform called
"sfrmAppointments" (recordsource= "tblAppointments"; has controls for fields
like [Appt-Date]).
I have a "mainswitch" form with a control box called [cboDate].
I want to do be able to do the following:
Enter a date in the [cboDate] box, and then through a click of a command
button called "filterfrmCharts" on the "mainswitch" form get the following:
Open "frmChart"
Apply a filter based on : sfrmAppointments.[Appt-Date] = [cboDate] value.
I am relatively new to access, and any details on the VBA code would be
greatly appreciated.
Thank you very much for your help.