Hi all,
Please help.
Why is this code not working?
The problem is actually in the Dim db1 as database.......any other way of dimming database?
The thing is i have also tried using the names of the database eg Dim Barclays As database
and Dim Customer As table still showing error and cant debugg...
Thank you all.
Shananne
Dim db1 As Database
Dim ta1 As Table
Private Sub Form_Load()
Show
'Link up to database
Set db1 = OpenDatabase(App.Path & "/../../database/Barclays.mdb")
Set ta1 = db1.OpenTable("Customer02")
'Put headings into Grid
grid1.Row = 0
grid1.Col = 1: grid1.Text = "C_no"
grid1.Col = 2: grid1.Text = "Title"
grid1.Col = 3: grid1.Text = "Surname"
grid1.Col = 4: grid1.Text = "First Name"
grid1.Col = 5: grid1.Text = "Intials"
grid1.Col = 6: grid1.Text = "City"
grid1.Col = 7: grid1.Text = "Post code"
grid1.Col = 8: grid1.Text = "Age"
grid1.HighLight = False
grid1.Rows = 2
grid1.Row = 1
End Sub
Private Sub Command1_Click()
Row = 1 'used by ADDItem to show position in Grid1 where record should go
Do While Not ta1.EOF
grid1.AddItem Chr(9) & ta1!c_no & Chr(9) & ta1!Title & Chr(9) & ta1!surname & Chr(9) & ta1!Firstname & (9) & ta1!initials & (9) & ta1!city & (9) & ta1!postc & (9) & ta1!age, Row
Row = Row + 1
ta1.MoveNext
Loop
End Sub