speakers_86
Registered User.
- Local time
- Today, 10:09
- Joined
- May 17, 2007
- Messages
- 1,919
I found this code that checks if the backend is connected, but it is not working for me.
If the backend is connected, I want label16 to not be visible. If the backend is not connected, label16 should be visible. Label16 contains refresh links code on click.
lstCustomerTitle is a table that should always have fields in it (Mr., Mrs., etc.).
edit- perhaps I should say what is not working with it! Regardless of the backend, the label is never visible. The if statement always returns err=0 as true.
Code:
Private Sub Form_Open(Cancel As Integer)
' Check links to the Back End Database; returns True if links are OK.
Dim dbs As DAO.Database, rst As DAO.Recordset
Set dbs = CurrentDb
' Open linked table to see if connection information is correct.
On Error Resume Next
Set rst = dbs.OpenRecordset("lstcustomertitle")
' If there's no error, return True.
If Err = 0 Then
Me.Label16.Visible = False
Me.Label16.Width = 0.001
Me.Label16.Height = 0.001
Else
Me.Label16.Visible = True
Me.Label16.Width = 1
Me.Label16.Height = 0.25
End If
End Sub
If the backend is connected, I want label16 to not be visible. If the backend is not connected, label16 should be visible. Label16 contains refresh links code on click.
lstCustomerTitle is a table that should always have fields in it (Mr., Mrs., etc.).
edit- perhaps I should say what is not working with it! Regardless of the backend, the label is never visible. The if statement always returns err=0 as true.