| Carl2406 2006-02-20, 1:24 pm |
| I have a switchboard form with 7 command buttons. My database is split
with tables BP-99 thru BP-07 in Building.mdb and Forms, reports, etc
are in Building_be.mdb.Code is written with Access 2000.Clicking a
button captioned 2007 executes the following code and opens the BP-07
table for editing:
____________________
____________________
____________________
Private Sub btn2007_Click()
On Error GoTo Err_btn2007_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "BP-07"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btn2007_Click:
Exit Sub
Err_btn2007_Click:
MsgBox Err.Description
Resume Exit_btn2007_Click
End Sub
____________________
____________________
____________________
__
When I add and click a new button captioned 2008, the following code
executes:
____________________
____________________
____________________
_________________
Private Sub Btn2008_Click()
On Error GoTo Err_Btn2008_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "BP-08"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Btn2008_Click:
Exit Sub
Err_Btn2008_Click:
MsgBox Err.Description
Resume Exit_Btn2008_Click
End Sub
____________________
____________________
____________________
____________________
____
Before clicking the new button, I have copied the table BP-07,
structure only, to a new
table BP-08 in Building.mdb. Copied a form for opening BP-08, changed
the Record Source to BP-08 and relinked the tables in Building_be.mdb.
Now when I click button BP-08 it opens
the table for BP-07. Even if I copy any of the other table structures
to BP-08. Clicking the BP-08 button still opens the BP-07 table.
Any help would be appreciated. I wrote the application 2.5 years ago
and have not used Access since then. All that I am asked to do now is
to all tables, forms and buttons for
BP-08 thru BP-16. This is a single user application not on a network.
|