473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Masked edit box

I have a masked edit box which has a value of "8/30/2004", and when i
programically set the value to mskedbox1=date, the vb blows up with an
invalid property value error. any ideas? It works ok if i set
mskedbox1="08/30/2004", but I can't seem to get the date value into the box.
I've even tried using format(date,"Short Date") to no avail. Format and
mask properties of the box are set to ##/##/####
Jul 17 '05 #1
2 9060
> I have a masked edit box which has a value of "8/30/2004", and when i
programically set the value to mskedbox1=date, the vb blows up with an
invalid property value error. any ideas? It works ok if i set
mskedbox1="08/30/2004", but I can't seem to get the date value into the box. I've even tried using format(date,"Short Date") to no avail. Format and mask properties of the box are set to ##/##/####


Don't set the Format property (only set the Mask property) and assign
the Date this way...

mskedbox1.Text = Format$(Date, "mm/dd/yyyy")

Note that I specify the Text property rather than assume VB will apply
it as the default property. Do so will make reading your code much
easier six months to a year from now when you (or, if you are working in
a company, the person assigned to the task) have to modify your code. As
for the form of the Format function's specification string... it much
match the format of the Mask property character for character (that
means leading zeroes must be preserved).

Rick - MVP

Jul 17 '05 #2
Thanks. That worked.

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:2Z********************@comcast.com...
I have a masked edit box which has a value of "8/30/2004", and when i
programically set the value to mskedbox1=date, the vb blows up with an
invalid property value error. any ideas? It works ok if i set
mskedbox1="08/30/2004", but I can't seem to get the date value into

the box.
I've even tried using format(date,"Short Date") to no avail. Format

and
mask properties of the box are set to ##/##/####


Don't set the Format property (only set the Mask property) and assign
the Date this way...

mskedbox1.Text = Format$(Date, "mm/dd/yyyy")

Note that I specify the Text property rather than assume VB will apply
it as the default property. Do so will make reading your code much
easier six months to a year from now when you (or, if you are working in
a company, the person assigned to the task) have to modify your code. As
for the form of the Format function's specification string... it much
match the format of the Mask property character for character (that
means leading zeroes must be preserved).

Rick - MVP

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: metridevkk | last post by:
Hi, I need to use a Masked Edit Control in my ASPX page. In VS.Net, I added the reference to MSMask.dll for my application & also added the MaskEdBox to the Toolbox. After adding the control to...
1
by: david | last post by:
Anybody could give me hint how use this control in asp.net web form. The problem is: I try to use COM component in my web form app by using MS training kit for windows form application. I would...
1
by: larry | last post by:
hi, using the masked edit control in vb.net, I have a control named mskbanknum when i set mskbanknum.text = "125" the value "125" is not displayed in the vb.net form the debugger verify's...
1
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form...
3
by: Panos | last post by:
Hi all, I can't clear a Masked edit control. I use it to input dates, so I have defined the mask as "##/##/####". I use the the well known meb.mask="" meb.text="" , but nothing happens. Does...
0
by: jin | last post by:
Hi, i sa wthe textbook said, # is a digit place holder which entry required while 9 is a digit place holder which entry optional actually what is the meaning of entry optional and entry required,...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
1
by: tom provan | last post by:
When I use the masked edit box, I can tab to it and the cursor will go to the start of the box. However if I click on it the cursor goes to wherever I clicked. How can I make a click go to start...
4
by: mwcapps | last post by:
I have unformatted text in my SQL 2005 database. I'm pulling it into a masked edit text box with a (999)999-9999 mask. Unfortunately, when I attempt to save the data back it doesn't work because I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.