|
|
I would think that your app is compiled as 64-bit. Since there are no 64-bit drivers for Access databases, you'll get this error.
Force the target to x86 and you'll limit the code to 32-bit, thus using the 32-bit drivers for Access that are installed.
|
|
|
|
|
I know this is something simple but it has been a while since i have written in Vb6 and now with vb.net I
was not sure if the same code would be accepted.
I am allowing a user to enter in a textbox numeric values
after he tabs to the next textbox I would like to format the numbers he/she entered to currency but without the "$"
so for example:
the first textbox the user would enter 12345, then he would tab to the next textbox
and the data he just entered would then we formatted to display as such: 1,234.50
Thanks for your time and help.
Again sorry that this is something a beginner should know but I just forgot.
|
|
|
|
|
PAguilar09 wrote: gain sorry that this is something a beginner should know but I just forgot.
Not at all, it's an intelligent question. The Format method on the string class lets you format a string, like string.Format( "{0:C}", textbox1.Text) wil, from memory, format a string as currency. The string.Format method is what you want to look up in general for help on how to format strings.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
ok so I am not sure if I am doing this in the right text box event.
I was trying this code in the lostfocus event but nothing worked.
Private Sub txtInitial_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInitial.LostFocus
txtInitial.Text = String.Format("{0:C}", txtInitial.Text)
End Sub
but when i enter in lets say: 123423
and then tab to the next text box nothing changes, or should i say the data that was entered does not change to 1234.23
what am i doing wrong?
|
|
|
|
|
As far as I can see from google, that is right. Have you set a breakpoint and perhaps set an intermediate string to the value, so you can check what is and what is not working ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is the lostfocus event the right one where i should be putting in the code?
when i run the program i enter in 12345 and then hit tab so the text box would lose the focus
but it still wont format
Private Sub txtInitial_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtInitial.LostFocus
txtInitial.Text = String.Format("{0:C}", txtInitial.Text)
End Sub
|
|
|
|
|
There is a FormatCurrency method that can be called to do the work for you.
It takes a number of parameters, which allow you to include things like leadin 0's, ()'s for negative numbers etc.
|
|
|
|
|
As mentioned, there is a FormatCurrency function, but if you do not what the currency symbol, the the FormatNumber may be a better option.
Also, I think I would use the Leave event of the TextBox, rather than the LostFocus event.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Mr Kreskowiak,
You stupid person.
I retired a few years ago. I bought a laptop for fun and enjoyment - learning visial basic has become a very satisfying hobby. I have no grandchildren and my wife recently died. Inane and ignorant remarks is obviously your low standard. I have not conned anybody.
I have posted genuine questions in these pages because I enjoy learning VB
Get your facts right before posting pathetic and remarks.
Stephen Comfort
Thanks for your help and advice!
Steve
|
|
|
|
|
Not even remotely the right forum for this, but to respond:
We are flooded here constantly with people asking questions like yours. Questions that either have no real world use and are someone's homework ( which is why you got lots of people trying to help you work towards the solution, the assumption being that giving you the solution would be doing you a disservice, because it would stop you from actually learning, or learning how to learn, if you were a student in a course ), or, worse. that are the paid work of some third world outsourcer who can barely type and who has in effect taken paid work from the very people who they then ask to do the work for them. People like yourself, who are just learning for fun, are such a minority, that they are hard to spot. I know that Dave, like myself, puts a lot of time into helping on these forums, BUT I also know we both try to lead the horse towards water, without actually pushing them into it, that is, to encourage people to use google, to buy and read books, to give them a nudge in the right direction, but not to write outright solutions to simple problems. Neither of us does this to tease or upset, we do it so that people who really want to learn, get help, and people looking to get free course credits, do not succeed. Again, that's the majority of what we see around here.
I am sorry for your loss, however, it's not really relevant, it shouldn't change how you're treated in a public programming forum. I'm sure that understanding where you're coming from in your approach to computing will color how anyone who reads this treats your questions in future, I can only state again, you've walked into a world where people who don't want to learn, try to get us to do paid work for them, and it's against that backdrop that it was assumed that you were trying to get us to do your paid work or homework for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
OK, since the gloves are off...
BluesEnd wrote: Get your facts right before posting pathetic and remarks.
Facts?? The only facts I had were the ones you posted in your orignal post, which wasn't much and didn't include your life story.
You sounded like every other idiot who comes here looking for us to do their work for them because they went to RentACoder and got some schmuck to pay them to do a project they're nowhere near qualified to write. After seeing that 20 times a day around here, it gets a little old. I'm sorry you got splashed by the artillery shell I lob at every one them.
|
|
|
|
|
Having a burst-out on the internet will get you nowhere.
History says you are likely to be ridiculed.
Sometimes it is just best to swallow or ignore another person's opinions.
In fact, why should you even care about the opinion of some one you dont know?
And the last tip. Never expect to win an argument on the internet
|
|
|
|
|
Hi.
First, you seem to be clueless about the net and forums. In most forums, such an asinine post is a guaranteed way to get banned! Especially since it's a direct attack.
BTW: I've was on email distribution lists before there was a "net". So, I'm about as far from being a newbie on the net as is possible.
Second, gee, guess the type of people that are on this forum. I taught Computer Engineering for 8 semesters. I taught everything from freshman programming to senior labs. I was also responsible for introducing a new course, and directly involved in the change over to a different programming language for a course. So, I know very well what the level of questions that a person asks implies about the poster.
I see by your profile, you've been a forum member for over two years. In that case, your question doesn't make any sense to me.
To be blunt, your question shows a complete lack of experience. I'd expect a freshman to know how to do what you asked by mid-course. And, that's with a freshman software course that's required by non engineers (such as math/science majors, etc).
Also, your question sounds a LOT like a homework question. People know, I'll quickly blast someone that I think is asking for code for their homework question.
Last, regardless of what you say, MY feeling is that you asking about a homework question.
Just my two cents....
______________
Joe
modified on Monday, September 21, 2009 3:00 AM
|
|
|
|
|
Opps,
I forget to add.
Websites are private operations.
Under the LAW, a person has ZERO RIGHTS in a forum. Is that clear - *ZERO*!
The web site owner has FULL CONTROL and 100% right to ban/accept anyone FOR ANY REASON THEY FEEL LIKE!
A web site or forum is NOT, I repeat - is NOT, a public right.
Of course, the standard laws still apply like libel, and such.
I've had my web sites for ~15 years. I've managed internal specialized websites for some companies that I worked for. And, I help friends manage their own small business web sites. So again, I'm far from a newbie when it comes websites, the law, and so on.
FWIW: I see a ton of copyright violations on websites and forums today. And, anyone that thinks that a Fortune 500 company doesn't know about the copyright violations is a fool. It's all a mater of what makes sense (and cents - as in cost ) for a company to go after. One of my former co-worker friends is a company lawyer that is involved in exactly that type of stuff.
So, just because you see someone get away with something, that doesn't mean that it's legal, proper, or allowed for other people.
I figured that you might be interested in the above.
__________
Joe
|
|
|
|
|
Hello every one
I got this code and i get figer out what is the problem with it
i get a green line under the first End FUnction and i dont no why
Can anyone help me out ?? please Thanks
Public Function whichbuttonpushed(ByVal _sender As String) As String
Try
SetActiveWindow(8975651603260375040) 'Set focus Active window
'I found this number("8975651603260375040") via getactivewindow method.
Select Case _sender
Case "btna"
keybd_event(VK_A, 0, 0, 0)
keybd_event(VK_A, 0, KEYEVENTF_KEYUP, 0)
shiftrelease()
altrelease()
leftaltrelease()
Case "btnb"
keybd_event(VK_B, 0, 0, 0)
keybd_event(VK_B, 0, KEYEVENTF_KEYUP, 0)
shiftrelease()
altrelease()
leftaltrelease()
Case "btnc"
keybd_event(VK_C, 0, 0, 0)
keybd_event(VK_C, 0, KEYEVENTF_KEYUP, 0)
shiftrelease()
altrelease()
leftaltrelease()
End Select
Exit Function '<=== green line under this
Catch ex As Exception
Exit Function
End Try
End Function
|
|
|
|
|
Your Function does not have a return value? Change it to a Sub or return something.
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
Thanks Andy works perfect now
Bob
|
|
|
|
|
My pleasure.
A little tip, when there is a green line under something, hover your mouse over the text and the intellisence will give you a hint as to what is wrong.
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
Also, 2 things just for your information:
1. like Andy_L_J already implied, you should use a function when you want the code to return some value. For example:
MsgBox("Half of 11 is " & Half_Is(11))
Private Function Half_Is(ByVal MyNumber As Double) As Double
Return MyNumber / 2
End Function
Otherwise use a sub.
2. When you write a function or sub, you do not need to explicitly tell the code to exit the function or sub at the end, nor in the catch clause (that is why you got the green squiggly line). Your code will exit there anyway.
Use Exit Function or Exit Sub somewhere in the middle, and only when you don't want the rest of the function's or sub's code to be executed.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks Johan
that help me out i apreciater that
to bad your at the other end of the world or i would buy you a beer
Thanks
Bob
|
|
|
|
|
No problem, if I would have liked beer, you could have sent it to me
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thats to bad you dont drink beer
i could send you some canadian whisky hehe
do you know if this post is about me ???
Re: Stupid remarks by stupid people who are an MVP
i was just going to add a new post not sure if i shold now
or maybe you will know i want to have a form animated press a button and the
forme will slide up for the bottom of the screen and press the button agine and it will slide down
Thanks agine for your help
Bob
|
|
|
|
|
The stupid people post was not about you, don't worry. The guy was not talking about the people asking questions, but about the people answering them.
As far as I can tell, your questions have been good so far.
Making a form slide in or out of view should be possible, but where will you put the button?
You better post a new question about it, because I am not sure I can help you with this one.
My advice is free, and you may get what you paid for.
|
|
|
|
|
ok good i was woried about that for a sec
i got the animation figerd out google helped me
it was pretty easy
are you going to give me your adress so i can send you some canadian Whisy hehe
Thanks
Bob
|
|
|
|
|