Sabtu, 24 Mei 2014

Re: [MS_AccessPros] Re: ACCESS 2010 FE/BE Server Issues!!!!

 

Matt-


Do it in Visual Basic.  I gave you sample code earlier, but here it is again in more detail.

Open the "switchboard" form in Design view.  In the property sheet, find the On Load event property.  Change that to [Event Procedure] and click the build (…) button next to the property.  That should put you in the VB Editor with the Load event template code started.

You need to add a couple of variables at the module level.  Your code will end up looking something like this:

Option Compare Database

Dim dbSwitch As DAO.Database
Dim rstSwitch As DAO.Recordset

Private Sub Form_Load()

    ' Point to this database
    Set dbSwitch = CurrentDb
    ' Open a recordset on any linked table
    Set rstSwitch = dbSwitch.OpenRecordset("tblXXXX")

End Sub

You'll need to fill in the name of any of your linked tables in place of tblXXXX.  That recordset will create a connection to the back end that will be reused by the rest of your application.  It will stay open until you close the switchboard form.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On May 24, 2014, at 5:09 PM, matthew.randolph83@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Thank you John. I hope I'm doing it now. So, how do I open the linked table from my switchboard? I'm a little confused. Again, thank you for all your help. Look forward to your reply.


Matt




---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :


Matt-

If you're using the website, when you click reply, you must also click "Show Message History".  Many of us use email only to monitor and reply, so when you fail to include the history, all we see is your current reply.  (I'm replying using the web interface so you can see the result.)

You don't need a "dummy" table to establish and hold the link - you can open any linked table.  Your hidden form is a simple way to do that, but I like to open a recordset in code in my "Switchboard" form that opens when the app starts.

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications 

SQL Queries for Mere Mortals 

http://www.viescas.com/ 

(Paris, France)


---In MS_Access_Professionals@yahoogroups.com, <matthew.randolph83@...> wrote :

John,

Am I not suppose to reply to the messages? How do I include the original thread? On to your comment. Yes I am talking about keeping a recordset open. What I've already have done is created a table in the BE called tblLINKED and a form on the local FE that opens in hidden view when database "switchboard" loads. What I was asking is would coding this in VBA stating open recordset be more efficient/better performance than creating a table and linking it to a FE form or is it simply preference? Thank you for your help. And please let me know how I can keep the original string of conversations because when I open the comment I see message history. Again, thank you.



Matt  

 

__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (18)

.

__,_._,___

Tidak ada komentar:

Posting Komentar