If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > error to save data using data control!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-04, 00:25
azifa7980 azifa7980 is offline
Registered User
 
Join Date: Aug 2004
Posts: 15
error to save data using data control!

hi,
can somebody please check for me the below coding:
Private Sub cmdSave_Click()
With Data1.Recordset
.AddNew
!oprid = txtOprID
!name = txtName
!type = cboType.Text
End With
Data1.Refresh

txtOprID = ""
txtName = ""
cboType.Text = ""
End Sub

the error is at the .AddNew.why??please help me!!
Reply With Quote
  #2 (permalink)  
Old 08-26-04, 11:11
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Question what is cboType for controle a textbox or combobox


if textbox
Private Sub cmdSave_Click()
With me.Data1
.Recordset.AddNew
.Recordset("oprid") = me.txtOprID.text
.Recordset("name") = me.txtName.text
.Recordset("type") = me.cboType.text
.update
.refresh
End With

me.txtOprID.text= ""
me.txtName .text= ""
me.cboType.Text = ""
End Sub

if combobox or listbox
Private Sub cmdSave_Click()
With me.Data1
.Recordset.AddNew
.Recordset("oprid") = me.txtOprID.text
.Recordset("name") = me.txtName.text
.Recordset("type") = me.cboType.boundtext
.refresh
End With


me.txtOprID.text= ""
me.txtName .text= ""
me.cboType.boundtext= ""
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On