I keep on getting the following error-
sub or function not defined.
Here is my code:
I get the error at the "r" on the first line of display:Code:Public ss, sc
Private Sub Form_Load()
s = "provider=microsoft.jet.oledb.4.0;data source=.\Invoice2.mdb;"
Set c = New ADODB.Connection
c.Open s
Set r = New ADODB.Recordset
'Set rs = New ADODB.Recordset
r.Open "Select * from Invoice", c, adOpenDynamic, adLockOptimistic
Call display
End Sub
Private Sub display()
txtInvoiceNo.Text = str(r(0)) & " "
txtDate.Text = r(1) & " "
txtcustomer = r(2) & " "
dbNamesl.Text = str(r(3)) & " "
txtnettMainsl.Text = str(r(4)) & " "
txtVatMainsl.Text = str(r(5)) & " "
txttotalMainsl.Text = str(r(6)) & " "
End Sub
Private Sub assign()
r(0) = txtInvoiceNo.Text
r(1) = txtDate.Text
r(2) = txtcustomer.Text
r(3) = dbNamesl.Text
r(4) = txtnettMainsl.Text
r(5) = txtVatMainsl.Text
r(6) = txttotalMainsl.Text
End Sub
txtInvoiceNo.Text = str(r(0)) & " " the r is highlighted and the error comes up.
Does anybody know what the problem is and how i can add information from another table within this code?
just a small example would do.
