Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am passing a variable from one on

Status
Not open for further replies.

CookieNZ

MIS
Apr 22, 2002
48
0
0
NZ
I am passing a variable from one one to the another e.g.

Public Sub mysub(ByVal number As Integer)

cmdsupport = dbconn.CreateCommand
cmdsupport.CommandText = "select * from supportcall where ID = '" & number & "'"
dbsupport.Fill(dssupport, "SupportCall")

However when the program fills the dataset, it crashes warning me that "Additional information: Argument 'Prompt' cannot be converted to type 'String'"

Do I need to convert the number variable somewhere?

It is an Access db connection
 
Have you tried:

Public Sub mysub(ByVal number As Integer)

cmdsupport = dbconn.CreateCommand
cmdsupport.CommandText = "select * from supportcall where ID = '" & CStr(number) & "'"
dbsupport.Fill(dssupport, "SupportCall")


Kris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top