Tip:
Highlight text to annotate it
X
I've made a copy of odb11
Radio Buttons and I'm calling this odb12
Dates and Dollar Signs. I've opened up the form
to show we're at the point we were at the end last video. We've got
to dates on here; a start date which should never change
and our end date that we don't know when that will be
but we do know that we want it to be a valid date. There
are a few things we can do to help out the person entering this form
make sure that it's a valid date. To look at those
we're going to go into "edit mode" so I'm going to close the form
and reopen it in edit mode
I'm going to hold down Control
and Click on the end-date text box. Right click
click on control to open up the Properties dialog box
In our list of fields we can see a Min date
and a max date - We may want to set those. We also have a date format
which is currently standard short let's change that
to year month day. We can put in a default date if we want
but since we don't know the end date we don't want to put one in this case
the next one's called spin button let's turn that on
and see what it does. I'm going to go into
edit view and there's no end-date in there now but if I click one of these arrows
it throws in an end-date of 1999
1201 If I click on one of these arrows
the up arrow increments the day, down arrow
decrements the day. If I click on the month
same thing for month - down
and up, and same thing for the year. Let's go back into
edit mode no we don't want to save any changes
holding down control clicking on the
end date - right below or spin button we get something called repeat
If I turn that on and go back
into Edit View now if I click one of those arrows
and hold down the arrow it will continue
decrementing or incrementing that day month or year
as long as I'm holding down those arrows. Going back into
edit mode, I'm going to hold down Control click and end date
there's one more thing I want to look at and that
is down here to bottom called the drop-down let's turn that a yes
and go into edit view - I have something selected so I need to
click of are the objects to bring back our labels
and now we've got our spin buttons but we also have
the drop-down button when a quick that it shows us
a little calendar we can click on today or
we can click none to have no date in there. We can click the
arrows to the right takes us to the next month the left arrow takes us to the
previous month
if I click and that month name it brings a little drop down for the previous year
current year or next year and then I can pick a month
in that next year and select a
on the calendar. Let's set the date back to none
and am going to save my form
close the form and save my database
For our start date
that one is not going to change but we want to change the format of that
I want to grab that same format that is on the table
so I'm going to tables I'm going to right click
and edit and we want to change the format of
the start date so if I click on start date
we see it down in the field properties down at the bottom
we get something called "format example" in that's in
month/day/year. I'm going to click dot dot dot
to bring up the dialog box this will allow me to change the format
some going to make this a date and I want something unusual
so that it will stand out in mind for our example
I'm going to pick out day dot month
year. Clicking OK
we want to save this
I'm going to close the table in now I'm going to double click on the table
and make sure that it came out we want
There's our start date and we see it in day dot
month year it's the way we want and the table
Let's go over to forms right click
edit we see the start date is still
in month day year format we don't want that
so I'm going to hold down Control and click and the start the text box
and delete it. Now I want to add something in to replace that
so I'm going over to my form controls I'm going to click on
formatted field
place in that in for my start date
right clicking; clicking on control to open the Properties dialog box
and I'm going to change the name to FMT
start date
going into the data tab
in the data field I want that to be the start date
and then back in general I just want this box to look like the others
so I'm going to make my border 3d
and the background color
is going to be gray 10% we also want to change the height
to .25. Now let's go into
design view and see how it looks
and there we have it! In the format day dot month year
going back into edit mode
I'm holding down control clicking and Start date
In our formatted field dialog box
we have a field called Formatting. If I clicked that dot dot dot
button we see we get the number formatting dialog box the same one we
had
for the table. So, if we don't like the date format there
we can change it in we've got a bigger selection here then we do with the
date-box
the differences if we have a date text box
we can at the spin button and the drop-down - Where
we don't have that choice for formatted field, but we have
a bigger variety of date formats
I like this as it is - so I'm going to save my form
close that and save my database
We're calling this video "Dates and Dollar Signs" and we haven't seen any dollar signs
yet
let's look at our table
if I right click in edit this
we don't see any fields that would make good
dollar sign values so let's add a new field
I'm going to call this hourly wage
and we want to change this to a format of
numeric.
We want to change the number decimal places to 2
and down here we've got
a "format example" just like we saw before
Let's click on the dot dot dot box and instead have date this time we want to
make this a currency
the default is decimal places 2
leading zeros 1. I like that, so will click OK
and if you don't change is decimal places in think the formatting
will work. It's just going to have .00 for all your values
you don't want that. So, make sure you change your decimal places to 2.
Let's save this table. Close it, and now we want to double click
to change the values on the table and going to
scroll right to see the hourly wage
and Let's putt in some values
I've added in the hourly wage for all of our employees
they are just made up salaries for our made up employees. Let's close this
go back into forms. I want
edit the form. I want to
add our new field to our form so I'm going to click on the
and field. It should be down at the bottom
hourly wage, click
drag this down to the bottom
I'm going to hold down Control click on the label part of
the field right click
open up the dialog box change the
vertical alignment to right going to click in the box here on the
left side and bring in
the box make them smaller I also want to move this
a little bit away from the text box so I'm going to arrow key to the left
just one click is good hold down Control
click in the text box from here
I want to change the height to .25. I
also want to change the border to 3D
and change the background color to be gray 10 percent. We can close the
Properties box
we can close our add field dialog box
clicking on the label now
selects both fields because they're grouped I'm also going to bring down
our buttons a little bit so I'm going to select all of them - just use me
arrow keys to bring that down - so it is even with the
hourly wage and let's see how this looks
by going into edit view we don't see our labels
to hit something selected so I need to click of are the objects
and it looks like
our hourly wage field turned out fine
so I'm going to save this close my form
and save my database all
all cool all
all