473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Button Click to launch MS Access DB Issue

This may be a simple fix but I'm not seeing it. My VB application calls MS Access by the click of a form button. Simple enough but here goes the problem:

As soon as my VB code opens the Access DB/Form, control returns to the next executable line in my VB code. The next executable set of code closes the DB and quits Access. In other words, MS Access loads and quits in a blink of an eye.

Is there a way to suspend the VB code from executing until control returns from MS Access? Another option is to check, within VB, if the Access DB is currently open (vb code example would be great). Either way would help.

Thanks.

Below is my VB code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CallBRS.Click

Dim oAccess As Object 'Access.Application
' Start a new instance of Access for Automation:
oAccess = CreateObject("Access.Application")
' Open a database in exclusive mode:
oAccess.OpenCurrentDatabase("C:\TotalScript BRS\BRS\BRS.mdb")
oAccess.DoCmd.OpenForm("BRS Account", Access.AcFormView.acNormal)


‘????? Problem is here ??????


'oAccess.CloseCurrentDatabase()
'oAccess = Nothing
'oAccess.Quit(True)
Exit Sub
End Sub
Oct 5 '06 #1
0 1519

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cvillard | last post by:
So I have a query... Yahoo mail uses a button that has two functions. If you click on the major portion it will launch your search. If you click on the image that is on the right of the button (...
5
by: Mr Gordonz | last post by:
Hi all, I want to put a button on a page, and when the user clicks it, the standard Windows "Open File" dialogue box opens, and the user can browse/select a file on their PC. Having selected a...
7
by: IntraRELY | last post by:
I am using the following command to launch and .NET VB Executable, which is a simple Windows Form (printCheckClient.exe). I am using a HyperLink Control and works perfect....
11
by: Sarah | last post by:
I have code that I want to run so that if the result is true, it changes the current button's ".DialogResult" property to "DialogResult.OK". Problem is, when I run this code on the ".Click" event...
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
1
by: regelcom | last post by:
My son is trying to create an about form button for a form he has already created. Any help would be great. Thanks
11
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register...
6
by: efultz | last post by:
I am trying to figure out how to click on a button and have it open a web page. I am not asking for the logic to handle the click. Moreover I am looking for the logic that I need to run to actually...
0
by: ARC | last post by:
Hello all, I've searched everywhere for this, and no luck. When you create a runtime, the small round help button does nothing when you click it. Does anyone know how to get it to launch your...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.