Selasa, 27 September 2011

Re: [MS_AccessPros] Attachment control

 

John,

If during the BeforeUpdate event I do field validation and find
something wrong, how do I stop the record from being added to the table
and keep the form on the screen for the user to make corrections?

Steve

On 9/27/2011 10:33 AM, John Viescas wrote:
> Steve-
>
> Why not just open a bound form in Data Entry mode? You can still validate stuff
> in the BeforeUpdate event of the form. Let Access do all the work.
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Steve
> Sent: Tuesday, September 27, 2011 3:51 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: Re: [MS_AccessPros] Attachment control
>
> Hi John,
>
> Why unbound? Well, it seemed a good way to gather the information needed
> for a new table record. When the user clicks the DONE command button, I
> do some error checking in the command button click event procedure and
> then an SQL INSERT INTO is used to add a new table record. Maybe that is
> not the best or even a good way to add a record to a table?
>
> Unbound or not, shouldn't double-clicking the attachment control bring
> up the Attachments panel?
>
> The attachments will typically be one or two files, most often pdf's or
> pictures.
>
> Thank you.
>
> Steve
>
> On 9/27/2011 8:42 AM, John Viescas wrote:
>> Steve-
>>
>> Why unbound?
>>
>> An attachment control is useless unless bound. What sort of attachment, and
> how
>> many? You could provide a command button to open a File dialog to locate the
>> file or files that should end up as attachments. Then to add the attachments,
>> you'll need to first create the record with all the non-attachment data, save
>> it, then open up the Recordset2 object of the attachment field to load the
>> files. I can dig up some sample code if you need it.
>>
>> John Viescas, author
>> Microsoft Office Access 2010 Inside Out
>> Microsoft Office Access 2007 Inside Out
>> Building Microsoft Access Applications
>> Microsoft Office Access 2003 Inside Out
>> SQL Queries for Mere Mortals
>> http://www.viescas.com/
>> (Paris, France)
>>
>>
>>
>> -----Original Message-----
>> From: MS_Access_Professionals@yahoogroups.com
>> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Steve
>> Sent: Tuesday, September 27, 2011 2:29 PM
>> To: MS_Access_Professionals@yahoogroups.com
>> Subject: [MS_AccessPros] Attachment control
>>
>> I have a table with about a dozen fields, one of which is the attachment
>> data type.
>>
>> I am developing a form with unbound controls which the user will
>> populate with information, click the DONE command button and add a new
>> record to the table.
>>
>> The form is working OK except for the attachment control. Double
>> clicking does not bring up the Attachments panel. Right clicking the
>> control brings up the context menu, but the Manage Attachments selection
>> is grayed out.
>>
>> What do I need to do to get the Attachment control to work?
>>
>> Thanks.
>>
>> Steve
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar