Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switchboard Does not show buttons or text 1

Status
Not open for further replies.

MC77

Technical User
Jul 24, 2001
8
0
0
US
Have a MS 2000 application that utilizes a switchboard. The .mde has been deployed on multiple PCs and works properly. Having difficulty on 1 PC (a laptop), when the app is launched it shows the main switchboard with none of the four application buttons present and a single functionless button with no text shown. Question why this would act differently on this 1 machine? Thanx.
 
Apparently your switchboard form have recordsource. Form hide all form Detail's objects if form recordset is without records and Form.AllowAdditions is set No.

Aivars
 
The Switchboard Items table has records, and the same table provides information to the application that works on other PCs.
 
In such case you may refresh links to tables.

Here are functions for deletind and creating links to another DB tables
Call LinksDelete 'Remove all links
'Create new links to specified DB
Call LinksCreateToSource("D:\MyDirectory\MyDatabase.mdb")
'----------------------------


Sub LinksCreateToSource(strLinkSourceDB As String, _
Optional prpProgressBar As Object)
'This procedure create links to tables of specified database
'strLinkSourceDB -> full DB path
'You can update progress bar value (optional) if your form have it
'in such case you may include it in the command as second parameter e.g.:
'Call LinksCreateToSource("D:\MyDir\MyDB.mdb", Me.MyProgressbar)


On Error GoTo Err_LinksCreateToSource
Dim dbs As Database
Dim tdf As TableDef
Dim TdfCount As Long
Dim i As Long

Set dbs = DBEngine.Workspaces(0).OpenDatabase(strLinkSourceDB)
'Count tables in the database what will be linked
If Not prpProgressBar Is Nothing Then
For Each tdf In dbs.TableDefs
If Left(tdf.Name, 4) <> &quot;MSys&quot; Then 'Do not create links to the System tables
TdfCount = TdfCount + 1
End If
Next tdf
'Update progress bar max value
prpProgressBar.Max = TdfCount
'Show progress bar
prpProgressBar.Visible = True
End If

For Each tdf In dbs.TableDefs
If Left(tdf.Name, 4) <> &quot;MSys&quot; Then 'Do not create links to the System tables
i = i + 1
If Not prpProgressBar Is Nothing Then
'Progress bar value updating
prpProgressBar.Value = i
End If
'Links create
DoCmd.TransferDatabase acLink, _
&quot;Microsoft Access&quot;, strLinkSourceDB, acTable, tdf.Name, tdf.Name
End If
Next tdf
dbs.Close
Set dbs = Nothing

If Not prpProgressBar Is Nothing Then
'Hide progress bar
prpProgressBar.Visible = False
End If

Exit_LinksCreateToSource:
Exit Sub

Err_LinksCreateToSource:
MsgBox &quot;Error No &quot; & Err.Number & vbLf & Error$, , &quot;Sub LinksCreateToSource&quot;
Stop
Resume Exit_LinksCreateToSource

End Sub

'--------------------------
Sub LinksDelete(Optional strConnectString As String = &quot;&quot;)
'This function remove links to tables with specified connections
'If is omited strConnectString all links will be removed

Dim tdf As TableDef

For Each tdf In CurrentDb.TableDefs
If tdf.Connect <> &quot;&quot; Then
If InStr(1, tdf.Connect, strConnectString, vbTextCompare) > 0 Then
DoCmd.DeleteObject acTable, tdf.Name
End If
End If
Next tdf
End Sub


Aivars

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top