How to use TimveValue to find a departure date later than a given time

Status
Not open for further replies.

Course

Board Regular
Joined
Aug 7, 2014
Messages
144
I asked a similar question earlier but i I made a mess of the code so can the moderators please delete it and use this on instead


I need to write an expression in the expression builder that finds a departure date between two given dates that is greater than a given time.

I have three controls on a form called Flights. The controls are named cboDeparture1, cboDeparture2 and cboGreaterThanTime. Both cbo.Departure controls are formatted as dd/mm/yyyy and the cbo.GreaterThanTime control is formatted as hh:nn


I have referenced these controls as criteria in the Departure field of the Query so that they will filter the Query based on whatever is entered into the controls.

I have tried this code but it doesnt work.

Code:
Between [Forms]![Flights]![cboDeparture1]
And
[Forms]![Flights]![cboDeparture2]
And
TimeValue([Forms]![Flights]![cboDeparture1])>[Forms]![Flights]![cboGreaterThanTime])
Can anyone help.

Thank you
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Please do not post the same question multiple times. All clarifications, directly-related follow-ups, and bumps should be posted back to the original thread. Per forum rules, posts of a duplicate nature will be locked or deleted (rule #12 here: Forum Rules).

Please continue on in your original thread. You already had a reply in it.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,221,828
Messages
6,162,215
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top