Populate a text box with result of date range query (1 Viewer)

AccessDabbler

New member
Local time
Today, 05:18
Joined
Jun 24, 2014
Messages
7
Hello, I've been trying to figure this out and am probably overthinking it :banghead:

my database has a text field that says "Period"

I have a date field called "Entry" and a date field called "Exit"

I want to write something that will populate the field "Period" with words to describe the dates in "Entry" and "Exit"

For instance if the Entry and Exit dates are between 1/1/1940 and 12/31/1949 I want it to populate the "Period" field with "Forties"
but it would also go on to 1/1/1950 and 12/31/1959 and populate "Period" with "Fifties" etc

Does this make sense to anyone? Can it be done?

Thanks!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:18
Joined
Jul 9, 2003
Messages
16,245
Yes, can be done. If I was doing it, I reckon I'd start by looking up convert numbers to words, or possibly, fill out cheque with words. Not exactly what you want, but might give you some ideas.

Sent from my SM-G925F using Tapatalk
 

AccessDabbler

New member
Local time
Today, 05:18
Joined
Jun 24, 2014
Messages
7
Yes, can be done. If I was doing it, I reckon I'd start by looking up convert numbers to words, or possibly, fill out cheque with words. Not exactly what you want, but might give you some ideas.

Sent from my SM-G925F using Tapatalk

Hmm...Not sure that is what I'm looking for. The example I gave was very simplified the actual dates and phrases are somewhat harder. I work for a Veterans service and I have to put in enlistment and discharge dates and list a war period for the veterans. Right now, I look at those dates, look at a chart on the wall, and use a combo box to put in the war period. My boss wants it to fill automatically. I'm starting to think it's more hassle than it's worth. Maybe I'll just tell him it can't be done...
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:18
Joined
Jul 9, 2003
Messages
16,245
From the information I gave in my first answer I found it difficult to find the VBA code I was trying to direct you to.

I did a couple of searches and found this:-
http://accessdatabasetutorial.com/2012/07/13/how-to-convert-numbers-to-words-access-vba-function/

And this info from our very own missinglinq:-
https://bytes.com/topic/access/insights/625202-converting-numbers-words

The VBA code gives you a rough idea of an approach you could use. It's definitely a working example at any rate, which is always handy!
 

AccessDabbler

New member
Local time
Today, 05:18
Joined
Jun 24, 2014
Messages
7
From the information I gave in my first answer I found it difficult to find the VBA code I was trying to direct you to

.…

The VBA code gives you a rough idea of an approach you could use. It's definitely a working example at any rate, which is always handy!

Thanks! I will look into those and let you know how I make out.
 

Users who are viewing this thread

Top Bottom