Hello again,
I would like to know how to write an expression for a Form or Query that would take my Height column and give me another column with the height converted to inches. I'm not even quite sure this is possible, since the format my Height Column is in is currently Text. I enter my height like so: 6'0 or 6'2.
Will I have no choice but to just list all heights in Inches?
No this is something you could do.
Here are some examples of how you could break it down:
I would add some error handling like, if the field doesn't contain the apostrophe symbol. Also the code above has that symbol in quotes, for vba you may have to change that to the vba char number.Feet = Left(FieldName, InStr(FieldName, "'") - 1) Inches = Right(FieldName, Len(FieldName) - InStr(FieldName, "'"))
I use a similar breakdown of a string in vba for my openargs on forms. I use the ; instead to split up the 2 variables i pass to every form i open. The left one on mine is the for primary key I want to open, and the right one is the form that called the open. So on close it knows which form to reopen.
Hope this helps,
Dan
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks