This database has been sanitized. Open the Navigation tab for Events. The event record has two date/time fields, the child form has corresponding fields. You may play with the one of the dates in the Event record.
SCATeam.zip
This database has been sanitized. Open the Navigation tab for Events. The event record has two date/time fields, the child form has corresponding fields. You may play with the one of the dates in the Event record.
SCATeam.zip
This is strange. I sent the posted a reply with the db, and I saw the post on this site, now I see the post has disappeared. I'll do it again.
The db has been sanitized. Go to the Navigation Tab called "Events". The parent form has two date/time fields to play with. Corresponding fields are in the child from.
Odd. Now I can see the earlier post!!!
SCATeam.zip
Sorry, with dates, you are wrong. If the controlsource of the control is a datetime datatype, it will store it as a date.The last zero just tell it to store the formatting characters in the record which uses up extra space.
Sounds like you do not know what a date datatype is - it is a decimal number (now is 43936.9675578704) the part before the dp represents the number of days since 31/12/1899 and the part after is a value expressed as the time divided by the number of seconds in a day (86400). What you see as a date is just a format of that number. So Access will convert and store 4/14/2020 07:15 to 43935.3020833333
I was just quoting from MS about the 2nd part of the input mask.
* The second part is optional and refers to the embedded mask characters and how they are stored within the field. If the second part is set to 0, the characters are stored with the data, and if it is set to 1, the characters are only displayed and not stored. Setting the second part to 1 can save database storage space.
https://support.office.com/en-us/art...8da#characters
yes, perhaps it's not very clear - but that is to do with storing in a text field something like a telephone number, bank sort code or card number and the like.
You enter text into a field as a date, providing that text can be interpreted as a date, and the underlying field is a date, it will be stored as a date - otherwise it will either generate an error or truncate the value in some way depending on the nature of the error. Note that for complete hours the user will still have to enter 1700 - they can't just enter 17 - that is one of the limitations of an input mask
Maybe I'm not understanding the problem. I added the input mask to the Beg_Date textbox in the subform. I enter
041520201748
and this is what gets displayed after I leave the textbox, as I'd expect with the format:
04/15/2020 17:48
Is that not what's happening for you, or not what you expect?
My primary issue is having to deal with entering the colon so many thousands of times over the years. I was attempting to use the Input Mask to streamline data entry, but I have not be able to get it to work properly in my forms. He, who goes by "pbady" said he was able to get the mask to work in his test db. He is now looking at my db to try to determine why I am unable to get it to work for me. It would be nice to be able to just type "041620200845" to get "04/16/2020 08:45". Currently, I enter a space for the "/" and Access deals with it. However, I still must enter the ":", which also involves using the shift key, because Access has no flexibility regarding the colon. So, currently, I enter: "04 16 2020 8:45". Access converts it to "04/16/2020 08:45". Access with also convert "20" to "2020".Not sure if this will help without knowing more about what you're doing, but storing the date and time in one field is easy enough by using Now function. If you want to show date and time separately on a form, format the bound date field as a date format that you like, and an unbound textbox formatted to show Time as military time. Could be as simple as
=Format(yourDateField,"hh:mm")
When I select the mask in the wizard, it inserts 00/00/0000\ 00:00;1;0; into the mask property of the Beg_Date of the main form. Then, when I return to the Form View, I get:Maybe I'm not understanding the problem. I added the input mask to the Beg_Date textbox in the subform. I enter
041520201748
and this is what gets displayed after I leave the textbox, as I'd expect with the format:
04/15/2020 17:48
Is that not what's happening for you, or not what you expect?
If I go into that field, and delete the # characters, I see the date/time as "04/11/2020 07:30:00 AM". Then, when I exit the field, it returns to the "to big" display.
this is a simple mockup that works for me.
In the form datefield control, check the input mask and format properties
Note I am in the UK so the date format is dd/mm/yyyy. You may need to change to US format of mm/dd/yyyy.
I didn't grasp from your initial post that it was about keyboard entry. I just thought you wanted to see date/time data as military time. If I had to do this, I suppose I'd try an input mask, but have rarely used them because I've read that so many people dislike their temperamental behaviour. The alternative would be a sub or function I suppose.My primary issue is having to deal with entering the colon so many thousands of times over the years.
I switched to the field you have pictured, added the input mask and it again appears to work. For the record the input mask is
00/00/0000\ 00:00;0
and the format is
mm/dd/yyyy hh:nn
Well, I tried it again, directly entering the mask as indicated and it seems to be working! I had earlier created the mask in the wizard and had bee using it. I had originally had the 2nd parameter as 0, but when that didn't work, I tried the 1 as indicated in the MS Guide. It still did not work. So, I guess something is wrong with the mask created in the wizard.
Thanks everyone for your help. This should simplify data entry. It reduces 4 strokes off the data entry.
personally I avoid using wizards, they are great to get a feel for what something might look like, but much much better to grow your own. If nothing else, you know what you've done, rather than something you are not sure aboutI had earlier created the mask in the wizard
Regarding your emailed question about relinking. Technical questions should be posed on the forum. You'll have a better chance at getting faster answers and it leaves a searchable archive for later users. The relevant bits:
I believe this line has an error:It occurs while putting a value into strBackEnd
strBackEnd = Right$(strCon, (Len(strCon) - (InStrRev(strCon, "") - 1)))
This places a “b” into strBackEnd
Then
tdf.Connect = ";DATABASE=" & CurrentProject.Path & strBackEnd
produces
;DATABASE=D:\Scateam\SCATeam\Scateam_Site - Documents\Team Managementb
An invalid name for the Team Management folder
strBackEnd = Right$(strCon, (Len(strCon) - (InStrRev(strCon, "") - 1)))
based upon how it's used later, it's supposed to end up with the name of the back end file, including the backslash. I think that line should be:
strBackEnd = Right$(strCon, (Len(strCon) - (InStrRev(strCon, "") - 1)))
which produces:
?Right$(strCon, (Len(strCon) - (InStrRev(strCon, "") - 1)))
\SCATeam_Data.accdb
Edit: since you only sent the front end, I didn't test.