|
cnurse wrote:
Arnie, try this simple change...
mydate = Format(cDate(Me.editHireDate.Text.ToString), "Short Date")
Nursey
I appreciate the input.
I used your idea/code (even took off the "ToString") and still *&*^*&
What I'm getting in return is what has caused me to look at options, settings and so on...
"Cast from string "01151995" to type 'Date' is not valid.
Arnie
|
|
|
|
|
Like cnurse said, but why does everyone execute .ToString() on something that's ALREADY A STRING! A .Text property always returns a String . Can someone explain to me, the purpose of converting a String to a String ? Sorry, one of my pet peeves.
Oh! And using Me to death pisses me off to! It's completely unnecessary...
mydate = Format(cDate(editHireDate.Text), "Short Date")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
LMAO! I have the same pet hates, but sometimes until somebody says "you don't need to" people's habits remain the same. I remember prefixing ME. in vb4 actually slowed it down coz the stupid environment even resolved the referemce too! so funny.
Another one of my pet hates is people not coding with Option Strict. There are lots of others and so little time hahahaha
Have a good XMAS mate.
Nursey
|
|
|
|
|
Well, Option Strict I don't have a problem with, because sometimes it goes get in the way. For example, you can't use any late binding with it turned on. It's very helpful to turn that off when you using WMI.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Oh! And using Me to death pisses me off to! It's completely unnecessary...
LMAO...But Intellisense makes it so useful to help remember all those names that I forget!
|
|
|
|
|
What? You can't remember your own object names!?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello, I am creating a database with access and I have a question involving a macro I have created. In the Begging line of the macro immediately following the Warnings on field in design view, I have a RunApp Command that executes a batch file which takes about three minutes to complete. The problem is, the rest of the queries being used in this macro depend on the new data brought in by the batch file. Can anyone suggest a way to get around this so taht the batch file can execute before I continue executing the rest of the macro? Thanks in advance for any help!
|
|
|
|
|
The RunApp command doesn't wait for the command it launched to complete. There is no way around this! You would actually have to convert your macro code into VBA code and launch it using the Shell (I think!) statement, which has an option to wait for the command to complete.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi! I´ve been trying to use a flash animation in my windows forms application. So far I have managed to show the animation and play it, but I can't find a way to know when the animation finishes. I have looked everywhere but it seems that there is no "OnStop" or "OnFinish" event. Can anyone help me? I would really appreciate it.
Thanks in advance,
Matias
|
|
|
|
|
I dug into this one about 6 months ago. There is no event of the name that you are thinking, but there is a OnReadyStateChange(int State) event. IIRC, State=4 is Complete. Macromedia doesn't support embedding Flash into a Windows app, so you're pretty much on your own here.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a TabControl with four tabs. Can anybody tell me how to turn off tabs so that they are not visible at all?
Here is what I’m trying but it doesn’t work:
TabControl1.TabPages(2).Hide()<br />
TabControl1.Refresh() ‘not sure if this is necessary<br />
FrmMain.ActiveForm.Refresh() ‘ I don’t want to do this but, again, I’m not sure if it is needed or not
I also tried:
TabControl1.TabPages(2).visible = false<br />
'...and the refresh stuff
And I tried:
TabPage2.Hide()
...and
TabPage2.visible = false
None of the above actions seem to have any effect on the tabs.
Does anybody have any suggestions?
Thanks
Brad
|
|
|
|
|
hi guys,
I have a label where data is outputed into it. I want to know how you are able to print that data out or send it to the printer when like a user clicks on a button called "print".
thanks
|
|
|
|
|
I have an aray of items I imported from an exteranl data source. Is it possible to turn the data into a typed dataset so I can sort and work with it in a datagrid?
|
|
|
|
|
hi,
I placed a combobox in datagird, it is displaying the data, but when i click in the new cell also it is displaying the combobox, but when i select the value from the combobox, that value is not storing in the current cell. when u click in someother cell that cell is going to be blank. but in the cell where already having the value if u click, it is showing the combobox, and even if we select another value that value is storing in the cell. and even i want to add a new value to the combobox.
pls tell me,
it is very urgent.
Thanks in advance.
Thiru.
|
|
|
|
|
What?
Is this an ASP.NET datagrid or a Windows Form datagrid?
Start again with the combobox. How are you placing it in a datagrid? how are you loading the combobox items? How are you loading the datagrid?What is the new cell that is also displaying the combobox?What is your goal for the grid and having the combobox? Are you getting errors? Show some error messages or some code?
|
|
|
|
|
sorry it is a windows form datagrid. retrieving data from sql server. i placed combobox in datagrid. the data which is backend from one of the field is displaying in combobox, but when i am adding new row in grid, it is not placing the value in grid from combobox. and even i want to add new value in the combobox. It is not giving any error.
Thank you for trying,
bye
|
|
|
|
|
there's error, "Wrong protocol or connection state for the requested transaction or request - Error number: 40006" --the failed line is Winsock1.SendData (Txtinput.Text)-- can u give me a hint Thank you
|
|
|
|
|
Without more information, like what version of VB your using, or even the code that is setting up and opening the connection, it's impossible to tell you, with any certainty, what's wrong.
But, on the assumption your using VB6, I'll point you at PRB: SendData Method Generates Error 40006[^] on MSDN. It's probably what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
trying to understand classes but come up with this problem
'how can i access this class, without putting a timer of the form, i.e the control has its own timer
Private Class clock
Inherits Timer
PublicFunction systemtime()
If Me.Enabled = FalseThen ' enable timer if not already
Me.Interval = 500 ' 1/2 secs
Me.Enabled = True
EndIf
systemtime = Now.Second 'get system second, cant be anthing just example.
EndFunction
PrivateSub Test_Tick(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Tick ' on tick run the function
systemtime()
End Sub
End Class
Friend Class Count
Dim test As New clock
Dim timer1 As New clock
Public Function displaytime() As String
displaytime = timer1.systemtime
End Function
End Class
PrivateSub Form1_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Load
Dim test As New Count
'********* problem here************
'because this is only run once
Label1.Text = test.displaytime() 'this only happens once
End Sub
EndClass
'is there a way of running this class and passing the data to the label withing the timer class?
Happy Xmas to all!
From
Shortcircuit Software!
|
|
|
|
|
You need to have an event that is fired by your class when the time changes or whatever it is you want to display, the form can then handle this and update the label:
Public Event UpdateTime As EventHandler
So to fire the event:
Protected Overrides Sub OnTick(e As EventArgs)
Me.SystemTime
'Some sort of test to see if you want to fire the event
If IsChristmas Then
RaiseEvent UpdateTime(me, EventArgs.Empty)
End If
End Sub Then in on the form:
Private Sub Clock_UpdateTime(e as EventArgs, sender as Object) Handles Clock.UpdateTime
Label1.Text = Clock.DisplayTime
End Sub
Hope this helps
Tom
|
|
|
|
|
Thanks for your help, i needed further info but you lead me in the right direction
i came up with this.... (this works!).....
Private WithEvents timer As Clock = New Clock
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = timer.systemtime
End Sub
Private Sub timer_UpdateTime(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer.Tick
Label1.Text = timer.systemtime
End Sub
Public Class Clock
Inherits timer
Public Event UpdateTime As EventHandler
Private Sub Test_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Tick
systemtime()
End Sub
Public Function systemtime()
If Me.Enabled = False Then
Me.Interval = 125
Me.Enabled = True
End If
systemtime = Now.Second
RaiseEvent UpdateTime(Me, EventArgs.Empty)
End Function
End Class
Thank you and have a Merry Xmas
Andy
|
|
|
|
|
i need to control 2 cmdbuttons between 2 Lan-PC . Can u give me some advices plz such as Tool , Component or Code . Thx
|
|
|
|
|
i need to control 2 cmdbuttons between 2 Lan-PC . Can u give me some advices plz such as Tool , Component or Code . Thx
|
|
|
|
|
You going to have to be alot more descriptive than that. What do you mean by "control"? Are you saying that you want one PC to click on button on another PC?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i mean ,if the cmdbutton on my computer clicked ,it would affect to the cmdbutton on your computer , which component should i use ? can u give me some advise .
|
|
|
|