I managed to link my database to VB..its functioning ok..i also created buttons to add,delete or change, find data....etc ,my problem is i now want to display each customer details..from other tables(i have customer, account and transaction tables)so far its only the customer table which is being on display. How do i link the other tables to my visual basic project?
What iam saying is if i want certain information from say accounts or transaction tables to be on the form when called....e.g customer balance,transaction dates..etc...how do i go about it?
Thanks.
vb
Private Sub Command1_Click()
current_command = "add"
Data1.Recordset.AddNew
End Sub
Private Sub Command2_Click()
current_command = "delete"
End Sub
Private Sub Command3_Click()
current_command = "change"
Data1.Recordset.Edit
End Sub
Private Sub Command4_Click()
On Error GoTo command4_Click_Error
If current_command = "add" Then
Data1.Recordset.Update
End If
If cuurent_command = "delete" Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End If
If current_command = "change" Then
Data1.Recordset.Update
End If
command4_Click_OK:
Exit Sub
command4_Click_Error:
x$ = "Error " & Err & " " & Error(Err)
MsgBox x$, 48, "Attempting to " & current_command
Resume command4_Click_OK
End Sub
Private Sub Command5_Click()
Data1.UpdateControls
End Sub
Private Sub Command6_Click()
On Error GoTo command6_Error
x = InputBox("Input first few characters of Customer Surname ", "Find on Surname")
Data1.Recordset.FindFirst "surname like " & "'" & x & "*" & "'"
command6_OK:
Exit Sub
command6_Error:
y = "Error " & Err & " " & Error(Err)
MsgBox y, 48, "Find on Surname"
Resume command6_OK
End Sub
*edit: Please use code tags in the future, thanks!
This post has been edited by Martyr2: 25 Feb, 2008 - 10:07 AM