• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

How update yes/no field in an unbound table

I have an unbound form which contains a combobox.  After the user has selected a record from the combobox I want the user to then be able to click a command button which I also have on the form.
When the user clicks this command button I want a field in a record in tblOutpurchase to be updated. The field name is "Complete" which is a yes/no field.  It is false by default and I want it changed to true.

I'm not sure of the syntax for the onclick event of the command button but it has to be something like:

update tblOutpurchase.complete = true where JobN = Me.cboJobN

Can someone help?

1 Solution
Rey Obrero (Capricorn1)Commented:

if  JobN is Number

currentdb.execute "update tblOutpurchase set complete = true where JobN = " & Me.cboJobN

if  JobN is Text

currentdb.execute "update tblOutpurchase set complete = true where JobN = '" & Me.cboJobN & "'"

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now