Click here to Skip to main content
15,913,669 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 23:18
plural21-Aug-07 23:18 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai21-Aug-07 23:31
SimulationofSai21-Aug-07 23:31 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 23:38
plural21-Aug-07 23:38 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai21-Aug-07 23:50
SimulationofSai21-Aug-07 23:50 
GeneralRe: IP Address of computers on a network Pin
plural22-Aug-07 0:41
plural22-Aug-07 0:41 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai22-Aug-07 1:02
SimulationofSai22-Aug-07 1:02 
GeneralRe: IP Address of computers on a network Pin
plural22-Aug-07 1:36
plural22-Aug-07 1:36 
QuestionFormat() is a type and cannot be used as an expression Pin
vbDigger'z21-Aug-07 21:10
vbDigger'z21-Aug-07 21:10 
ERROR:Format() is a type and cannot be used as an expression

Why is it this function works smoothly in VB.NET 2003?

Format(1234, "0000")

but when i try to used it in Visual Basic 2005
an error occurs just like this...

'Format' is a type and cannot be used as an expression

here's my code:

****************************************

Function AutoGenerateEmpID(ByVal strSQL As String) As String

Try

Dim strID As String
Dim strCharYr As String
Dim strDigit As String

openDB() 'this is just my customized function..

dbRecordset.Open(strSQL, dbConnection)

strDigit = Format(Val(dbRecordset.Fields("IDNo").Value) + 1, "0000") 'my error occurs here...

strCharYr = Microsoft.VisualBasic.Right(Year(Now), 2)
strID = strCharYr & "-" & strDigit
'dbRecordset.Fields(0).Value

closeDB() 'this is just my customized function..

Return strID

Catch ex As Exception

MsgBox(ex.ToString())

End Try

End Function


***************************
Note: expect that dbRecordset.Fields("IDNo").Value returns an numbers which is in the form of string
***********************************

Please help....
I cant figure it out my self why is that so??
Is it there something i just forgot to imports some namespace or what??
Please help...

Thanks in advance!! Smile | :)
AnswerRe: Format() is a type and cannot be used as an expression Pin
Christian Graus21-Aug-07 21:49
protectorChristian Graus21-Aug-07 21:49 
QuestionWho can help me? Pin
Wlink21-Aug-07 20:33
Wlink21-Aug-07 20:33 
AnswerRe: Who can help me? Pin
Ahamed Azeem21-Aug-07 23:20
Ahamed Azeem21-Aug-07 23:20 
GeneralRe: Who can help me? Pin
Wlink21-Aug-07 23:27
Wlink21-Aug-07 23:27 
GeneralRe: Who can help me? [modified] Pin
Ahamed Azeem22-Aug-07 0:03
Ahamed Azeem22-Aug-07 0:03 
GeneralRe: Who can help me? Pin
Wlink22-Aug-07 0:33
Wlink22-Aug-07 0:33 
GeneralRe: Who can help me? Pin
Ahamed Azeem22-Aug-07 0:38
Ahamed Azeem22-Aug-07 0:38 
GeneralRe: Who can help me? Pin
Wlink22-Aug-07 1:32
Wlink22-Aug-07 1:32 
GeneralRe: Who can help me? Pin
Ahamed Azeem22-Aug-07 2:19
Ahamed Azeem22-Aug-07 2:19 
GeneralRe: Who can help me? Pin
Vasudevan Deepak Kumar22-Aug-07 4:44
Vasudevan Deepak Kumar22-Aug-07 4:44 
AnswerRe: Who can help me? Pin
Vasudevan Deepak Kumar22-Aug-07 4:43
Vasudevan Deepak Kumar22-Aug-07 4:43 
QuestionBest Practices to work with databases using VB .NET Pin
RaveRare21-Aug-07 19:22
RaveRare21-Aug-07 19:22 
AnswerRe: Best Practices to work with databases using VB .NET Pin
Christian Graus21-Aug-07 20:02
protectorChristian Graus21-Aug-07 20:02 
GeneralRe: Best Practices to work with databases using VB .NET Pin
RaveRare21-Aug-07 20:21
RaveRare21-Aug-07 20:21 
GeneralRe: Best Practices to work with databases using VB .NET Pin
Mark Churchill21-Aug-07 20:54
Mark Churchill21-Aug-07 20:54 
GeneralRe: Best Practices to work with databases using VB .NET Pin
RaveRare21-Aug-07 21:33
RaveRare21-Aug-07 21:33 
GeneralRe: Best Practices to work with databases using VB .NET Pin
Christian Graus21-Aug-07 21:48
protectorChristian Graus21-Aug-07 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.