Quote:
|
Originally Posted by ankiesiau
Code:
Dim conMember As ADODB.Connection
Dim rsMember As ADODB.Recordset
Private Sub cmdAdd_Click()
If cmdAdd.Caption = "&Add" Then
adoMember.Recordset.AddNew
txtMemberID.SetFocus
cmdSave.Enabled = True
cmdAdd.Caption = "&Cancel"
DisableButton
Else
adoMember.Recordset.CancelUpdate
EnableButton
cmdSave.Enabled = False
cmdAdd.Caption = "&Add"
End If
End Sub
When i click add, a msg box occurs. Run time error'91': Object variable or with block variable not set.
How to solve it?
|
ur adoMember is an Adodc control? if so then.
u must connect ur some controls to ur adodc
txtMemberID.Datasource = adoMember
txtMemberID.Datafield = <name of the fields of ur table>