I'm SO Close!

Apr 6, 2005

:mad: I could really use some help here! Apparently, completing a mail merge automation process is much more complicated than I originally thought. I have it doing absolutly everything I need it to do (open merge document, merge data, print, and close all in the background) but I am missing one critical but probably simple step. I want to merge just the CURRENT record only, not the entire database. I've read all 500+ posts concerning merging, but I'm still lost.

-how do I specify just the current record's information?
-do I need to create bookmarks, and how do I do this?
-how do I properly use the WHERE statement?

This may be the last thing I need to do with my database, if I can get it working right. Currently, it's trying to print all 883 records and takes about 10 minutes to run the command (probably because it's trying to pull all of the records instead of just one.) I will post my code, if you like. I know this is simple, but I can't work it out on my own. Please help me!

View Replies


ADVERTISEMENT

Close

Jan 22, 2007

Hi,

I used ShellExecute function to open the speicific pdf file,

I want to create a button which can close the speicific pdf file.

Are there any API function to close the file?

View 1 Replies View Related

MS Access Needs To Close!

Jul 11, 2005

If I start access and try to create a new database or view any database after a second or so this dialog box saying access needs to close appears. It has only happened after I closed the program and it asked if i wanted to save the current dbase. If I view the offending database (by copying it via a pen drive) on my other computer every thing works perfectly!
I have tried the "repair program", same result. I have reinstalled the program, same result. I have totally uninstalled Office XP professional and reinstalled it SAME RESULT! As I am not a programmer I am at a loss!

View 14 Replies View Related

Close Another Database

Jul 28, 2005

I am using code in Access to run a merge in Word. I'll call the database containing the function (MergeWord) that runs the merge Database1. The table used in the merge is in a different database. I'll call the database that contains the table Database2. When the merge is run, another instance of Access is automatically opened with Database2 open. How do I close the second instance of Access (Database2)?

Here's my code so far:
Function MergeWord()
Dim ObjWord As Word.Document
Set ObjWord = GetObject("H:SHAREDFORMSTest.doc", "Word.document")
ObjWord.Application.Visible = True
ObjWord.MailMerge.OpenDataSource NAME:="H:AccessDatabase2.mdb", Linktosource:=True, Connection:="TABLE NewFileExport"
ObjWord.MailMerge.Destination = wdSendToNewDocument
ObjWord.MailMerge.Execute
ObjWord.Application.NormalTemplate.Saved = True
ObjWord.Activate
ObjWord.Close False

Set ObjWord = Nothing

Exit Function
End Function

View 6 Replies View Related

LDB File Won't Close

Sep 29, 2005

We have a couple Access 2000 database's that are updated from Oracle data each night. There is a routine that opens Access, updates, then closes. However, on numerous occations, when it closes, the ldb file is still there. I can not delete the file without rebooting the server which I do not want to do every day.

Also, I noticed that the ldb file date is changed when I exit Access not when the db is opened. I thought the opposite was suppose to happen.

Any ideas?

Thanks,
SKK

View 11 Replies View Related

Close Button

May 8, 2006

i have close button on my form made thru the command button. But it does not show an error message when the form closes if information has not been entered in the reqired fields. it does not save the field though. how can i get the error messages to be shown before the form closes asking the suer to enter the missing data. thanks

View 2 Replies View Related

Close The Form

Mar 1, 2007

When the user clicks to close the form the Before Update event runs, and has the following code to check that all the required fields are completed:

If IsNull(Me.ToxReceived) Then
stdresponse = (MsgBox("You must enter the toxicology received date before continuing." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & _
"Do you want to do that now? Click YES to return to complete the form, click NO to undo the record", vbYesNo, "Missing Data"))

If stdresponse = vbYes Then
Me.ToxReceived.SetFocus

Else
Cancel = True
Me.Undo
Exit Sub
End If
End If

If the user clicks no, and the record is undone, how do I get the close form event to still continue?

D

View 14 Replies View Related

Compact On Close

Apr 19, 2007

Hi,

I apply Compact On Close (Tools->Option->General tab). So, every time, it will compact the database when closing the file.
However, will it do repair the database automatically? It seems just do compacting.

View 1 Replies View Related

On Close Event

Jun 8, 2007

I used the following code in the on close event of my form and it works when the value of [maingameformation.playid] is not previously entered but if there is already a value there it won't overide it? Is this possible to do?


Private Sub Form_Close()
[Forms]![gameentryfrm]![maingameformation.playid] = Me.playid
End Sub

View 4 Replies View Related

When I Close The Form

May 9, 2005

i put a button that run the command "docmd.close" but i found when i click it it close the form but with saving all data in field in the table, but this button should cancel record insertion, i hope i can find the answer here.

Thank you
Best Regards

View 1 Replies View Related

When [How?] To Close A Form..

May 13, 2005

I have a form that I want only to be opened from another form (i.e. the user presses a button from form1 and form2 is magically displayed).

My solution: In form2, I check to see if form1 is open in "use" mode. If not, I display a message and close form2.

The problem: The close code (docmd.close) is at the beginning of Form_Current. Apparently, Form_Current doesn't like to be interrupted. I receive a run-time error 2585 (This action can't be carried out while processing a form or report event).

Ok, so, umm, how exactly am I supposed to close the form? I tried the check during Form_Load instead, using the cancel variable instead of the docmd.close. However, I don't think this code got executed. It's almost like the form was already loaded or the Form_Load occurs after Form_Current (In my handy chart here, it says that Form_Current occurs when a form containing data is first opened and when you move to a different record.. so, I suppose it is possible).

Any thoughts?

View 3 Replies View Related

Close Two Forms Together

Jun 14, 2005

How can I close two forms at the same time. to close the first form I use DoCmd.Close how can I do form 2 from the same button, Thanks

View 3 Replies View Related

Close Form

Jan 13, 2006

I'm trying to close one form by using a button on another. This is my code:

DoCmd.Close acForm, frmSimCount

It dosen't work but comes up with an error:

Run-time errer '2493'

This action requires an object name.

I thought that was the name of the form, which is frmSimCount, could someone put me in the right direction please.

View 3 Replies View Related

Pop Up Message On Close Of DB

May 9, 2006

How can i setup a popup message when the user closes the DB.

I need to have an reminder to the user every time they shut the program down!

View 4 Replies View Related

On Close Event

Jun 17, 2005

Hi all - Having a problem getting my macro to run with the ON CLOSE event of a form. Before users exit the form (or database completely), I want the macro to run. The macro is designed to run an update query that updates 3 fields in my main table. Right now, the macro runs and but it only updates 2 of the 3 fields. It's as if the database closes before the update query gets a chance to finish. Any ideas on this?

Thanks,
Dan

View 3 Replies View Related

LDB File Won't Close

Sep 29, 2005

We have a couple Access 2000 database's that are updated from Oracle data each night. There is a routine that opens Access, updates, then closes. However, on numerous occations, when it closes, the ldb file is still there. I can not delete the file without rebooting the server which I do not want to do every day.

Also, I noticed that the ldb file date is changed when I exit Access not when the db is opened. I thought the opposite was suppose to happen.

Any ideas?

Thanks,
SKK

View 4 Replies View Related

SetFocus On Close

Feb 15, 2006

I'm having an issue with part of my code. I have a logout function which closes one form and then reopens the login form. It does this fine, but I can't type in any of the text boxes on the login form unless I close it out and reopen it manually. Here's the code:

vb Code: Original - vb Code Private Sub cmdLogout_Click()On Error GoTo Err_cmdLogout_ClickDoCmd.OpenForm "userlogin", acNormal, , , acFormReadOnly, acWindowNormalForms!userlogin!txtuserid.SetFocusDoCmd.Close acForm, "Control Panel", acSaveNoForms!userlogin!txtuserid.SetFocusExit_cmdLogout_Click:Exit SubErr_cmdLogout_Click: MsgBox Err.Description Resume Exit_cmdLogout_ClickEnd Sub Private Sub cmdLogout_Click()On Error GoTo Err_cmdLogout_ClickDoCmd.OpenForm "userlogin", acNormal, , , acFormReadOnly, acWindowNormalForms!userlogin!txtuserid.SetFocusDoCmd.Close acForm, "Control Panel", acSaveNoForms!userlogin!txtuserid.SetFocusExit_cmdLogout_Click:Exit SubErr_cmdLogout_Click:    MsgBox Err.Description    Resume Exit_cmdLogout_ClickEnd Sub

I've tried setting focus as shown above, but still no luck. Any ideas?

Thanks,

JMH

View 2 Replies View Related

How To Have Actions At The Close Of Mdb

Jul 13, 2006

How can I perform an action when ever the db closes…
Basically I have a table, users, and when the db starts a logon form is used. Once the logon is successful it records into the user table that a user is logged in. I want to at the close of the db rewrite the record to show that the user is not logged in.

So say user A logs in successfully so then the users table would show
Key | Name | password | logged date | currently logged on(these are the column headers)
Somekey | user a | ***** | somedate | yes

I want to rewrite the yes to a no when the db closes and the user is currently not logged on.
For the rewrite I can use a simple SQL statement to update the users table, the question is where would I place this code, the on close property for the switchboard is not enough, is there an on close property for the entire db.

View 3 Replies View Related

On Close Event

Mar 28, 2007

Hi all

On closing a report, I am prompted to save it (because I've changed a record source when it opened)

However, I don't want to save it.

Is there an command I could use during the on close event (or something similar) to get rid of the prompts??

Thanks

View 1 Replies View Related

Form Won't Close

Dec 9, 2012

why a form won't close. Each time I try to I am prompted to save and when I do, the form doesn't close. When I closed the DB and reopened, none of the changes were saved.

View 6 Replies View Related

Cannot Close DB In Multiuser Environment

Mar 17, 2006

When users try to close Access 97 databases (and this happens in several offices) we sometimes get the following three messages e.g.

Couldn't save; currently locked by user 'Admin' on machine 'CSL600'

Followed by

The Save Operation Failed

Followed by

Out of Memory

Any solutions?

View 4 Replies View Related

Run Queries On Close Of DB Without Form??!!

Oct 25, 2006

Hi,
I want to have some queries run during the database is closed, like the functiona with "Repair on Close". But I don't want to use a form with a VBA code doing it. Is there any other possibility to do it? :confused:
Thanks in advance for answers.:)

View 14 Replies View Related

Close Button Without Compacting

Nov 10, 2006

The database that I currently work with has the option chosen to compact and repair on close so that if I am not present when there is trouble the users can close the db and the problem is usually corrected. I currently have a close button on the Main switchboard that closes the db. Is there a way to make a button or another way that will close the db that will by pass the compact and repair choice? I know that I can use task manager, but that usually creates db1, db2 and so on.
Thanks,

View 3 Replies View Related

Another DateDiff Question... I'm Soo Close!!

Mar 12, 2008

I have the following code in an expression.
I don't know why this isn't working! I feel like i've tried everything :(

I have an unbound text box on a form called "Aging".
I want it to show the number of days since the record was created.

=DateDiff("d",[txtDateAdded],Date())


I've also tried VB with no luck...

Dim TheDate As Date
TheDate = Me![txtDateAdded].Value
DateDiff("d", Now, TheDate)

View 14 Replies View Related

Booking Too Far In Advance Or Too Close

Mar 24, 2006

Hello everyone, if anybody could help me I'd deeply appreciate it.


Booking ID = the time when it is booked over the phone
Hiring ID = the time when the event is to be held

Basically I have to make some booking dates, and use January and February 2006 as test data. My only dilemma is it says that the booking dates must not be booked more than 8 weeks before the hiring, and at least 1 week before it. So if someone wanted to the hiring for 01/01/06, then they wouldn't be able to book before 01/11/05, but before 25/12/05. Can anybody help me? Thanks. I need it so that whatever the hiring date is, the booking date has to be no more than 8 weeks in advance, but 1 week before the hiring.

View 4 Replies View Related

Form Refuses To Close?!

Mar 9, 2005

Hi,

I've got a database with a linked table to a CSV file which is automatically extracted from some logging software. The Database is used to search for text strings (e.g. "example") within several fields wichin the automated extract and then show the results with any duplicated instances taken out (via an append to table query which is indexed with no duplicates).

So:

Text is entered
FieldA is looked through for a match, if a match is found the whole record gets appended to the Append table.
FieldB is looked through and if a match is found the whole record (including field A) is appended, however if the match has already been found in A, then the record is not copied.
It does this for several fields and then you get a table which is every record containing the searched for text with no duplicates.
This table is then displayed as a subform on another form in it's "table" view.

The form I'm trying to close is the form which contains the above subform.

I've tried:

A macro with close -> form -> formname which doesn't work.
Code:
Private Sub Toggle2_Click()
On Error GoTo Err_Toggle2_Click


DoCmd.Close

Exit_Toggle2_Click:
Exit Sub

Err_Toggle2_Click:
MsgBox Err.Description
Resume Exit_Toggle2_Click

End Sub

Which also doesnt work!

HOWEVER, just to make things interesting, if I click to view the form design, then run the form again, it will close fine using either method. It just seems not to work on the initial run of the text search which then opens the form displaying the subform.

Any ideas?? I can't understand why it won't work.

Cheers - Hope I explained it ok :)

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved