Hi ,I am using Visual Basic Backend SQL
I create form in which i create Command button
NEW ,MODIFY, VIEW,SAVE,EXIT
all my programme is running but when i add new record and save and then
i press VIEW button it gives error
i.e Object VAriable or with block variable not set
my code is
Private Sub Command1_Click( ) ' Add New Record
sql = "select max(right(clien t_no,5)) as client_no from client_master"
Set rs = conn.Execute(sq l)
mn = rs("client_no" )
If rs("client_no" ) <> "" Then
nc = Format(mn + 1, "00000")
Else
nc = "00001"
End If
Text1.Text = "C" & nc
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Text2.SetFocus
mmode = "save"
end sub
Private Sub Command3_Click( )
rs.Close
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Combo1.Enabled = True
Command2.Enable d = True
Command4.Enable d = True
rs.Open "select * from client_master", conn, adOpenDynamic, adLockOptimisti c
'sql = "select * from client_master"
'Set rs = conn.Execute(sq l)
Call viewrecord
Command8.Enable d = True
Command9.Enable d = True
Command10.Enabl ed = True
Command11.Enabl ed = True
End Sub
Plese tell me how to do
I create form in which i create Command button
NEW ,MODIFY, VIEW,SAVE,EXIT
all my programme is running but when i add new record and save and then
i press VIEW button it gives error
i.e Object VAriable or with block variable not set
my code is
Private Sub Command1_Click( ) ' Add New Record
sql = "select max(right(clien t_no,5)) as client_no from client_master"
Set rs = conn.Execute(sq l)
mn = rs("client_no" )
If rs("client_no" ) <> "" Then
nc = Format(mn + 1, "00000")
Else
nc = "00001"
End If
Text1.Text = "C" & nc
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = ""
Text2.SetFocus
mmode = "save"
end sub
Private Sub Command3_Click( )
rs.Close
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Combo1.Enabled = True
Command2.Enable d = True
Command4.Enable d = True
rs.Open "select * from client_master", conn, adOpenDynamic, adLockOptimisti c
'sql = "select * from client_master"
'Set rs = conn.Execute(sq l)
Call viewrecord
Command8.Enable d = True
Command9.Enable d = True
Command10.Enabl ed = True
Command11.Enabl ed = True
End Sub
Plese tell me how to do
Comment