Hi - I have written the code below to open a table called 2666, which is located in a different database called mini (located on my c drive)'
On clicking a button, I want the loaded form to display the data from the external database - I do not want the data to be changed - just to be available for viewing.
At present when I click the button with my code, nothing is happening (not even errors). Can someone help me out?
Many thanks Mark
Private Sub btn_LOAD_ACCOUNT_DblClick(Cancel As Integer)
Dim rs As Recordset
Dim db As DAO.Database
Set db = OpenDatabase("c:\mini.mdb", , ReadOnly, False)
On Error Resume Next
Set rs = db.OpenRecordset("select * FROM 2666")
If Err > 0 Then
MsgBox "Can not open Account", , "ABBICUS"
Set Me.Recordset = rs
Me![Txtdate].ControlSource = "date"
Me![TxtTYPE].ControlSource = "type"
Me![TxtAmountIN].ControlSource = "Amount In"
Me![TxtAmountOUT].ControlSource = "Amount Out"
End If
On Error GoTo 0
End Sub
On clicking a button, I want the loaded form to display the data from the external database - I do not want the data to be changed - just to be available for viewing.
At present when I click the button with my code, nothing is happening (not even errors). Can someone help me out?
Many thanks Mark
Private Sub btn_LOAD_ACCOUNT_DblClick(Cancel As Integer)
Dim rs As Recordset
Dim db As DAO.Database
Set db = OpenDatabase("c:\mini.mdb", , ReadOnly, False)
On Error Resume Next
Set rs = db.OpenRecordset("select * FROM 2666")
If Err > 0 Then
MsgBox "Can not open Account", , "ABBICUS"
Set Me.Recordset = rs
Me![Txtdate].ControlSource = "date"
Me![TxtTYPE].ControlSource = "type"
Me![TxtAmountIN].ControlSource = "Amount In"
Me![TxtAmountOUT].ControlSource = "Amount Out"
End If
On Error GoTo 0
End Sub