Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting a check box in a different table

Status
Not open for further replies.

MisterEkted

Technical User
Mar 5, 2007
10
US
I have an invoice form (based on an "invoices" table) where I can select from a list of completed jobs from a "jobs" table. The "jobs" table has a check box "job invoiced?" that I would like to set to "yes" when the "print invoice" event happens.
 

To tick the checkbox:

Forms(FormName)!CheckBoxName = -1

To untick the checkbox:

Forms(FormName)!CheckBoxName = 0

The checkbox on the current record of the form holding it will be set, according to which code you use. Be aware that the form holding the checkbox has to be open or the code will throw an error.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
To update the [JobInvoiced] field in table [Jobs] to "True", you could add the following to your PrintInvoice_Click routine:
Code:
    DoCmd.RunSQL "UPDATE Jobs SET Jobs.JobInvoiced = True" & _
        " WHERE (((Jobs.JobID)=" & [comboJobID] & "));"
Note: This assumes that you select the completed job from a combo box named "comboJobID", and that it contains the JobID in the first column.

Regards,
Lisa

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top