E
enrico via AccessMonster.com
i tried to create a button with no help of a wizard. it worked out well until
the save part, it doesn't save at all. it doesn't show any error either. this
my code behind the button:
If Nz(Me.txtHospital, "") = "" Then
MsgBox "Please enter name of hospital."
Me.txtHospital.SetFocus
Exit Sub
End If
If Nz(Me.cboCategory, "") = "" Then
MsgBox "Please enter category of hospital."
Me.cboCategory.SetFocus
Exit Sub
End If
If Nz(Me.cboClassification, "") = "" Then
MsgBox "Please enter hospital classification."
Me.cboClassification.SetFocus
Exit Sub
Else
sSQL = ("INSERT INTO tblHospital(Hospital, " & _
" Address, " & _
" Category, " & _
" Classification, " & _
" TelNo) " & _
"VALUES ('" & Me.txtHospital & "', " & _
" '" & Me.txtAddress & "', " & _
" '" & Me.cboCategory & "', " & _
" '" & Me.cboClassification & "', " & _
" '" & Me.txtTelNo & "')")
End If
MsgBox "Data saved.", vbInformation
End Sub
what's the problem with it?
the save part, it doesn't save at all. it doesn't show any error either. this
my code behind the button:
If Nz(Me.txtHospital, "") = "" Then
MsgBox "Please enter name of hospital."
Me.txtHospital.SetFocus
Exit Sub
End If
If Nz(Me.cboCategory, "") = "" Then
MsgBox "Please enter category of hospital."
Me.cboCategory.SetFocus
Exit Sub
End If
If Nz(Me.cboClassification, "") = "" Then
MsgBox "Please enter hospital classification."
Me.cboClassification.SetFocus
Exit Sub
Else
sSQL = ("INSERT INTO tblHospital(Hospital, " & _
" Address, " & _
" Category, " & _
" Classification, " & _
" TelNo) " & _
"VALUES ('" & Me.txtHospital & "', " & _
" '" & Me.txtAddress & "', " & _
" '" & Me.cboCategory & "', " & _
" '" & Me.cboClassification & "', " & _
" '" & Me.txtTelNo & "')")
End If
MsgBox "Data saved.", vbInformation
End Sub
what's the problem with it?