Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2010, 01:08 AM
Registered User
 
Join Date: Oct 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access 2007 attachment control is out of control

I have a form that is related to a main form. Their relationship is in place.
The related form only opens through a button on the main form. The forms are tabbed.

When I start a new record on the related form, I have a problem.
On the first field when I enter the first character, sometimes the second field, which is an attachment field, displays an icon indicating that an attachment is present, and I haven't even clicked on the attm icon yet.
It's a new record. This is driving me nuts.

I click on the attachment and have to remove the file manually. I suspect that some attachments that were deleted while testing, have not been properly disposed of, and Access keeps them internally in a hidden file.

Help will be appreciated.
 
Old October 14th, 2010, 01:53 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

I would make sure that the sub form is showing the correct related records.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
 
Old October 14th, 2010, 02:49 AM
Registered User
 
Join Date: Oct 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Coach. Yes, it shows correctly the related records; I am using on-activate event when switching back to the related form.

I may have found the solution; still testing though. Two things I did to the main form:
a) No longer do I have the (only) subform disabled, which would be enabled according to events.
b) No longer do I use KeyPreview, which I was using for keyboard user's convenience.

And in the related form:
a) Took the first 2 lines out the macro when related form was deactivated:
Condition Action Arguments
[newrecord] And Not [Dirty] CancelEvent
... StopMacro
RunCommand SaveRecord

and just kept the SaveRecord command.

UNKNOWNS
Don't know why the KeyPreview setting to Yes on main form, creates problems with attachments.
Or, was it the subform being disabled and enabled again at some point.

If I find it's not enough, I'll come back here in a hurry again.
Thanks Coach.
 
Old October 24th, 2010, 04:54 PM
Registered User
 
Join Date: Oct 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Attachment field misbehavior

Hello everyone,

This is just to seal the hanging thread.

I finally found the real cause for the attachment field misbehavior.

As you know, the attachment icon was having some 'intruder' files that
attach to the field, unsolicited. When I started a new record on this related form, and typed a character on a regular field, sometimes the attachment field would present an attached file out of nowhere.

The cause was the filter that was being applied on a new record.

On an existing record, the filter should be applied to display the corresponding record, but not when a new record is being created.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inconsistent result sets from SharePoint 2007 People Picker control lvirden SharePoint Development 0 December 17th, 2009 08:37 AM
How to specify relative path to Access 2007 in ADO connection string? [Excel 2007] sektor Excel VBA 4 September 3rd, 2009 11:59 PM
DropDown control problem [Excel 2007] sektor BOOK: Excel 2007 VBA Programmer's Reference ISBN: 978-0-470-04643-2 0 May 13th, 2009 06:20 AM
DropDown control problem [Excel 2007] sektor Excel VBA 0 May 13th, 2009 05:59 AM
Article: Creating a New Silverlight 2 Control for SharePoint 2007 jminatel BOOK: Professional Microsoft SharePoint 2007 Development Using Microsoft Silverlight 2 ISBN: 978-0-4 0 February 11th, 2009 10:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.