re-write the error message?
can you rewrite an error message easily?
heres the scenario:
forms text box, links to the DB which has a setting of "short date" therefore, if the user puts any format other than this 00/11/0000, it of course whinges with error 13 "type mismatch"
Can I re-write this error so that when it pops up the user will see rather than run time error something like "Check your date format"?
other than that, I dont know how to write into the program "the Database requires you to put the date into the dd/mm/yyyy format" sort of thing...
any ideas?
Re: re-write the error message?
That should not be a problem but instead of a textbox why don't you use a monthview control?
Re: re-write the error message?
in all honesty sid, I havent the foggiest I have never even heard of a mouthview...
1 Attachment(s)
Re: re-write the error message?
Quote:
Originally Posted by
JayCR
in all honesty sid, I havent the foggiest I have never even heard of a mouthview...
No it is not mouthview :lol: (sorry couldn't help it...)
It is MonthView. You can either use monthview or Date Picker
Here is a snapshot
Re: re-write the error message?
on right click of the toolbox, I have "Components, Add Tab, Dockable, Hide"
after selecting components, I dont have the same screen as you... I have 3 tabs "Controls, Designers, Insertable Objects" the location at the bottom states "c:\winnt\system32\vsflex3.ocx" and I dont have any of the options that you do... im guessing thats not a good thing?
James
Re: re-write the error message?
Quote:
Originally Posted by
JayCR
can you rewrite an error message easily?
The answer should be YES, however you would need Error-Handling for that, which you don't have!
The message you got is system generated, in order to give the user another message for that situation you have to write code for that error. After doing that, you could give the user any message you want in case of that error!
Re: re-write the error message?
Which MS Office version Are you using?
Re: re-write the error message?
Microsoft Office 2000, Windows XP x32, VB6... oh, I should say this is in VB6 and not VBA
Re: re-write the error message?
Vb6...
No Wonder :D
Quote:
on right click of the toolbox, I have "Components, Add Tab, Dockable, Hide"
Go to Projects --> Components --> Check the "Microsoft Windows Common Controls-2 6.0(SP6) "
Edit:
I have requested a mod to move this thread...
Re: re-write the error message?
Thread moved from 'Office Development/VBA' forum to the 'VB6' forum
(thanks for letting us know Sid :thumb: )
Re: re-write the error message?
[QUOTE=koolsid;3608074]Vb6...
No Wonder :D
Go to Projects --> Components --> Check the "Microsoft Windows Common Controls-2 6.0(SP6) "
QUOTE]
Just to be akward
1. I just realised I am actually working on a virtual machine, windows 2000 on the xp platform, my bad...
2. I only have Microsoft Windows Common Controls-2 6.0, no service pack after the name
3. I have just gone through and the options after the right click remain the same as 5 posts up!
Re: re-write the error message?
Quote:
Originally Posted by
si_the_geek
Thread moved from 'Office Development/VBA' forum to the 'VB6' forum
(thanks for letting us know Sid :thumb: )
My Bad Si, sorry I didnt realise I had it in the complete wrong place...
Re: re-write the error message?
Can you right click on the component, navigate to "Microsoft Windows Common Controls-2 6.0" and posta snapshot...
Also
Check this FAQ Item by Si
http://www.vbforums.com/showthread.php?t=489287
you might also be interested in
http://www.vbforums.com/showthread.php?t=489286
1 Attachment(s)
Re: re-write the error message?
Hope this helps
Note:
I have just found the DT Picker, and its allowing me to choose a date, but I cant select the time...
Second Note: I think I have found it under the "custom properties" of the DTpicker... I think it looks like I am there...
So looking at this it allows me to choose dates like this, however is there a simple function to draw out a fully digital calander onto a form?
Re: re-write the error message?
If you look on the left hand side of the pic. Right at the bottom... The second Icon from the bottom next to DatePicker is the Month View control...
Re: re-write the error message?
Yeah I have foudn it, the DTpicker works fine ont hat front, and produces a little calender which will definately do, however when I set it up so the DTpicker is used for time, I have put a custom control on there, and now when I use the drop down box, on the area where the time is entered, it gives me another calender to select a date, can this be changed?
at present I think I am just going to go back to my text box for the time if its not fairly easy to fix...
Re: re-write the error message?
I would use separate DTP's, one for the date (with dropdown) and one for time (with up/down).
Using a textbox is either unsafe or a lot of extra work (and in either case is less user friendly).
Re: re-write the error message?
Thanks for that Si, I will have to give that a go!