Home > Archive > MS Access database support > February 2006 > Adding Tables and Forms to an Application









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Adding Tables and Forms to an Application
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.

Carl2406

2006-02-20, 8:24 pm

Forget it! I found that I was copying the linked table instead of using
File;Get External Data and clicking on the true table. Also I reversed
the names of Building.mdb and Building_be.mdb in my original post. True
tables are in Building_be.mdb not in Building.mdb. Hope no one has
wasted time on my first post.

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com