Fantasic, thanks guys!
One last problem. How do I kill the Access application as well as the database? At the moment the database is closed but leaves the Access window.
Lisette
Hi,
I put this in (my form is called form1):
Private Sub Form1_Unload()
objAccess.CloseCurrentDatabase
Set objAccess = Nothing
End Sub
But still nothing happens when I close the form.
Incidentally, when I use the following code which only uses the word Form as an identifier (not Form1) it...
Hello, beginner here.
I want an Access database to be closed as a VB form is closed. Firstly I'm not sure how to call the procedure, I thought it would come under:
Private Sub Form_Close()
However nothing happens when I close the form, so I assume that is wrong.
Secondly, I want the Access...
Hi,
I worked and then it stopped!
This is what I have now, there are no errors and Access starts up and the form opens then Access closes itself with no error codes.
Private Sub Command1_Click()
Dim objAccess As New Access.Application
Dim Application As String
Application = "C:\Program...
Thank you. That stops the Run time error 91.
This is the latest code I'm trying.
Private Sub Command1_Click()
Dim dbMyDB As Database
Dim rsMyRS As Recordset
Dim objAccess As New Access.Application
Dim Application As String
DBEngine.SystemDB = "C:\WINNT\SYSTEM32\system.mdw"
Application =...
Thank you for your reply. Ok, I now have:
Private Sub Command1_Click()
Dim dbMyDB As Database
Dim rsMyRS As Recordset
Dim objAccess As Access.Application
Dim Application As String
Application = "C:\Program Files\Office97\Office\MSACCESS.EXE"
Set dbMyDB = OpenDatabase("C:\TideWeather.mdb")...
Im writing it in VB and producing an executable that checks that my database is updating a text file. If it hasn't updated for 20 minutes I want it to automatically close the access database and then re-open it.
As a start I have been trying to open the database. It opens access but hangs up...
Can anyone tell me why this doesn't work? I am new to VB but it seems to me that this should just work! It comes up with run time error 2486.
Private Sub Command1_Click()
Dim dbMyDB As Database
Set dbMyDB = OpenDatabase("C:\TideWeather.mdb")
DoCmd.OpenForm ("Start Sending")
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.