[AccessD] Check box on a form

Kaup, Chester Chester_Kaup at kindermorgan.com
Thu Feb 2 08:53:48 CST 2012


I put the following code in the After Insert event of the form. When entering data on the form after the last field to enter data is completed the query runs and the results come up on the screen. I then close the query but the result is not saved to the table. Filed is a yes/no field. Should it be a select or an update query? Thanks for the assistance.

Private Sub Form_AfterInsert()
    DoCmd.OpenQuery ("qry Previously Test Flag")
End Sub



-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
Sent: Wednesday, February 01, 2012 4:16 PM
To: Access Developers discussion and problem solving; Access Developers discussion and problem solving
Subject: Re: [AccessD] Check box on a form

My mistake - it should have been "After Insert".  This is an event 
for the form.  When a new record is inserted then use the value of 
your query to set the value of your check box.

David

At 2/02/2012, Kaup, Chester wrote:
>I get the first part of your comment but you lost me on To get the 
>value of the query into the field you can use code (on Insert) .
>
>Are you talking about an event because I see no such event as on insert.
>
>Thanks.
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com 
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
>Sent: Wednesday, February 01, 2012 3:32 PM
>To: Access Developers discussion and problem solving
>Subject: Re: [AccessD] Check box on a form
>
>Hi Chester,
>
>The control source needs to be the field that you want the data
>stored in.  To get the value of the query into the field you can use
>code (on Insert) .
>
>Regards
>
>David Emerson
>Dalyn Software Ltd
>Wellington, New Zealand
>
>At 2/02/2012, Kaup, Chester wrote:
> >I have a form that is used for data entry into a table. On the form
> >is a check box. The control source for the check box is a query
> >(=[qry Previously Test Flag]![Flag]). I have tried the query on its
> >own and it works fine. No data from the check box is getting saved
> >to the table. I am thinking that I need to do something to trigger
> >the query. Is that correct?
> >
> >
> >Chester Kaup
> >
> >Engineering Technician
> >
> >Kinder Morgan CO2 Company, LLP
> >
> >Office (432) 688-3797
> >
> >FAX (432) 688-3799

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list