Need some Vb support

  • BlueHat
  • Banned
  • Banned
  • User avatar
  • Posts: 589
  • Loc: Cyprus

Post 3+ Months Ago

Need some Vb support

Code: [ Select ]
Private Sub cmdReport_Click()

If Combo2.Text = "" Or Combo3.Text = "" Then
MsgBox "Please Select the month and the year", vbExclamation, "Error"
Combo2.SetFocus
Else


strsql = "SELECT username, Department, problemDescription, ITname, solutionDescritpion, day, month, year, Time, AM/PM FROM Computer " + _
"Month = '" + Combo2.Text + "'" + "and Year = '" + Combo3.Text + "'"
DataEnvironment1.Commands("Command1").CommandText = strsql
DataReport1.Show
Unload Me
Unload DataEnvironment1
End If
  1. Private Sub cmdReport_Click()
  2. If Combo2.Text = "" Or Combo3.Text = "" Then
  3. MsgBox "Please Select the month and the year", vbExclamation, "Error"
  4. Combo2.SetFocus
  5. Else
  6. strsql = "SELECT username, Department, problemDescription, ITname, solutionDescritpion, day, month, year, Time, AM/PM FROM Computer " + _
  7. "Month = '" + Combo2.Text + "'" + "and Year = '" + Combo3.Text + "'"
  8. DataEnvironment1.Commands("Command1").CommandText = strsql
  9. DataReport1.Show
  10. Unload Me
  11. Unload DataEnvironment1
  12. End If

--------------------------------

I get an error says syntex error on from cluase

Any support
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • akaash
  • Beginner
  • Beginner
  • akaash
  • Posts: 62
  • Loc: Gujurat,India

Post 3+ Months Ago

Code: [ Select ]
strsql = "SELECT username, Department, problemDescription, ITname, solutionDescritpion, day, month, year, Time, AM/PM FROM Computer WHERE" + _
"Month = '" + Combo2.Text + "'" + "and Year = '" + Combo3.Text + "'"
DataEnvironment1.Commands("Command1").CommandText = strsql
DataReport1.Show
Unload Me
Unload DataEnvironment1
End If
  1. strsql = "SELECT username, Department, problemDescription, ITname, solutionDescritpion, day, month, year, Time, AM/PM FROM Computer WHERE" + _
  2. "Month = '" + Combo2.Text + "'" + "and Year = '" + Combo3.Text + "'"
  3. DataEnvironment1.Commands("Command1").CommandText = strsql
  4. DataReport1.Show
  5. Unload Me
  6. Unload DataEnvironment1
  7. End If


I suppose u forgot 'WHERE".

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: demonmaestro and 80 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.