Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Help Po sa VB 2010!ASAP

grayfullbuster

Recruit
Basic Member
Messages
15
Reaction score
0
Points
16
sir may eror po akong nakukuha ang error po ay:
Syntax error in INSERT INTO statement.

i think ppo sir may prob ako sa data access

eto po yung code ko:
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
connect()
If Me.cboSec.Text = "" Then
MsgBox("Pls Choose Your Section", MsgBoxStyle.Information, "Invalid")
Me.cboSec.Focus()
ElseIf Me.cboDay.Text = "" Then
MsgBox("Pls Choose The Date", MsgBoxStyle.Information, "Invalid")
Me.cboDay.Focus()
ElseIf Me.cboSubjCode.Text = "" Then
MsgBox("Pls Choose Your Subject Code", MsgBoxStyle.Information, "Invalid")
Me.cboSubjCode.Focus()
ElseIf SubN.Text = "" Then
MsgBox("Enter Sub Name", MsgBoxStyle.Information, "Invalid")
Me.SubN.Focus()
ElseIf cboU.Text = "" Then
MsgBox("Pls Enter Units", MsgBoxStyle.Information, "Invalid")
Me.cboU.Focus()
ElseIf Me.txtTime.Text = "" Then
MsgBox("Enter Time Wtf", MsgBoxStyle.Information, "Invalid")
Me.txtTime.Focus()
ElseIf txtRoom.Text = "" Then
MsgBox("Enter Enter Room", MsgBoxStyle.Information, "Invalid")

Else
rs.Open("select * from tblSched where FacultyID = " & Me.cboFacid.Text & "", con, 3, 3)
If rs.RecordCount = 0 Then
rs.Close()
rs.Open("insert into tblSched(FacultyID, subjectID, day, time, room), values (" & Me.cboFacid.Text & ", " & Me.cboSubjCode.Text & ", '" & Me.cboDay.Text & "', '" & Me.txtTime.Text & "', '" & Me.txtRoom.Text & "')", con, 3, 3)
MsgBox("Record Added", MsgBoxStyle.Information, "Added")

End If
End If
con.Close()
End Sub



TYpo
 
sir may eror po akong nakukuha ang error po ay:
rs.Open("insert into tblSched(FacultyID, subjectID, day, time, room), values (" & Me.cboFacid.Text & ", " & Me.cboSubjCode.Text & ", '" & Me.cboDay.Text & "', '" &

rs = RecordSet ba yan?
 
Malamang yung day at time na field name ay mga Reserved Word sa MS Access
 
rs.Open("insert into tblSched(FacultyID, subjectID, day, time, room), values ('" & Me.cboFacid.Text & "', "' & Me.cboSubjCode.Text & '", '" & Me.cboDay.Text & "', '" & Me.txtTime.Text & "', '" & Me.txtRoom.Text & "')", con, 3, 3)

try mo yan.paste mo na lang yan.
 
Back
Top Bottom