Filter on combo box (Main Form and Sub Form)

  • Thread starter alpapak via AccessMonster.com
  • Start date
A

alpapak via AccessMonster.com

Filter on combo box
------------------------------------------------------------------------------
--

Hi there
I have a table displayed as a datasheet on a main form. There's a combo box
to pick the date on the main form.

How do I filter the subform (table) based on the Date selected in the combo
box?

The main-sub form looks something like this...
_________________________________

| Pick a date 3/3/2006 \/ | ===>Mainform
_________________________________

| Round Date Name Time |
| 1 3/3/2006 Bob 34.26 | ===>Subform
| 1 7/3/2006 Neal 32.45 |
_________________________________


Thanks

MainForm = [Details]
ComboBox = [DatePick]
SubForm = [SubDetails]
DetailsID
Round
Date
Name
Time
 
S

strive4peace

use the controlname of your pick date for LinkMasterFields,
and the controlname of the date in the subform for
LinkChildFields, which are both properties of the subform
control

also, change the name of your fields and your controls from
Name (property), Date (function), Time (function), and Round
(function) -- as these words are Reserved and should not be
used for user-created names


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
A

alpapak via AccessMonster.com

thxs
step by step pls
i am new
use the controlname of your pick date for LinkMasterFields,
and the controlname of the date in the subform for
LinkChildFields, which are both properties of the subform
control

also, change the name of your fields and your controls from
Name (property), Date (function), Time (function), and Round
(function) -- as these words are Reserved and should not be
used for user-created names

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
Filter on combo box
------------------------------------------------------------------------------
[quoted text clipped - 28 lines]
Name
Time
 
S

strive4peace

turn on the properties window

from the menu --> View, Properties
OR
right-click and choose Properties from the shortcut menu

click on the ALL tab

click on the control for your date on the main form

scroll to the top of the properties window ...
1. what is the NAME property?

click on the date control in your subform
2. what is the NAME property?

click somewhere on the main form to deselect the subform

click ONE time on your subform control
click on the DATA tab in the properties window

3. in LinkMasterField --> type NAME of date on main form
4. in LinkChildFields --> type NAME of date in subform

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com

thxs
step by step pls
i am new
use the controlname of your pick date for LinkMasterFields,
and the controlname of the date in the subform for
LinkChildFields, which are both properties of the subform
control

also, change the name of your fields and your controls from
Name (property), Date (function), Time (function), and Round
(function) -- as these words are Reserved and should not be
used for user-created names

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com

Filter on combo box
------------------------------------------------------------------------------

[quoted text clipped - 28 lines]
Name
Time
 
A

alpapak via AccessMonster.com

Thxs a lot
turn on the properties window

from the menu --> View, Properties
OR
right-click and choose Properties from the shortcut menu

click on the ALL tab

click on the control for your date on the main form

scroll to the top of the properties window ...
1. what is the NAME property?

click on the date control in your subform
2. what is the NAME property?

click somewhere on the main form to deselect the subform

click ONE time on your subform control
click on the DATA tab in the properties window

3. in LinkMasterField --> type NAME of date on main form
4. in LinkChildFields --> type NAME of date in subform

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
thxs
step by step pls
[quoted text clipped - 25 lines]
 
S

strive4peace

you're welcome ;) happy to help

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com

Thxs a lot
turn on the properties window
from the menu --> View, Properties
OR
right-click and choose Properties from the shortcut menu

click on the ALL tab

click on the control for your date on the main form

scroll to the top of the properties window ...
1. what is the NAME property?

click on the date control in your subform
2. what is the NAME property?

click somewhere on the main form to deselect the subform

click ONE time on your subform control
click on the DATA tab in the properties window

3. in LinkMasterField --> type NAME of date on main form
4. in LinkChildFields --> type NAME of date in subform

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com

thxs
step by step pls

[quoted text clipped - 25 lines]
Name
Time
 
A

alpapak via AccessMonster.com

thx for the reply

i use the following code and change combobox with two textbox StartDate and
EndDate

Private Sub EndDate_AfterUpdate()
[Forms]![Details]![SubDetails].Form.FilterOn = True
[Forms]![Details]![SubDetails].Form.Filter = "[Date] Between #" & Me.
StartDate & "# AND #" & Me.EndDate & "#"
End Sub

when i put [StartDate]= 1/1/2006 and [EndDate]= 5/1/2006
the filter show the SubDetails from 1/1/2006 until 1/5/2006
i use dd/mm/yyyy format in my control panel

i also test my SubDetails as a query and it works fine

Why StartDate and EndDate change the format from dd/mm/yyyy to mm/dd/yyyy??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top