[AccessD] program update & capitalization of fields

John Clark John.Clark at niagaracounty.com
Thu Jan 7 09:38:26 CST 2010


Thanks Heenan! This helps quite a bit
 
Regarding 2/ ..."Me.Dirty = False"...this seems to do the trick...I've only tested it once, and I'll have to run through more, but it looks promising. I figured it was something like this...I thought it was a "requery" or something. I've never had to deal w/the "dirty" property before, so it didn't even occur to me...I'd only ever read about it really.
 
Regarding 1/ ..."txtSomeTextBox = Ucase(txtSomeTextBox)" ...six in one; half dozen in the other, right? Yes, this looks like it would work. But, I've already begun w/placing the code, "KeyAscii = Asc(UCase(Chr(KeyAscii)))", in the keypress event, and it is also working, so I think I'll just go ahead w/that, unless you know of any caveat that makes this a bad decision. It looks good, because no matter what the user does, it will be an instant cap...and, like I said, it works.
 
Did you ever have one of those days, where it is a good thing you're not left alone, in room, w/a MS representative...you'd get in some trouble? I've had a few of those moments, doing this very small program. Thankfully, I took on something small like this, before diving into anything larger, using 2007.
 
I've discovered something else that 2007 has done, that is pissing me off...everything seems to be a macro now...when I insert a button, it goes the macro route, instead of the code route. I like code. I've got to look and see if there is a setting for this...doubt it though.


>>> "Heenan, Lambert" <Lambert.Heenan at chartisinsurance.com> 1/7/2010 8:42 AM >>>
Re 1/

This does seem to be a nice new bug in Access 2007. In previous versions the use of ">" in the format property of a field does what you expect: the text is *displayed* as all caps in the table, forms, queries, and report, though the actual data stored is still whatever happens to be typed. I just tested this in Access 2002 to be sure.

It seems that the code meisters in Redmond have dropped a ball win v 2007.

However, it is easy enough to work around this. If you want to actually store the data as all caps then (assuming you are using a bound form) you could just add a line of code to the LostFocus and/or Exit events of the text box where the data is entered:

txtSomeTextBox = Ucase(txtSomeTextBox)

Alternatively, base your report on a query which does the same thing when the query is run...

Select Ucase(SomeField) as MyTextFiled...

Regarding 2/ 

It sounds like the process needs the record to be saved before continuing. So instead of leaving the record and returning to it, just put this line at the start of the sub that runs when the button is clicked...

Me.Dirty = False

That line results in the data being saved.

Lambert




More information about the AccessD mailing list