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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox on datasheet?

Status
Not open for further replies.

hblabonte

Programmer
Oct 3, 2001
84
US
I have a form where a user selects an item(invoice #) from a combo box. Once the item is selected, a subform is populating displaying all records associated with the invoice.

What I'd like to do is have a checkbox listed on each record. If an item has been processed, I want to check the box to "on". Unfortunately, when using a datasheet or continuous form the checkbox will be turned on for every record.

Does anyone know of a way to edit a field on each record independent of the other records? Is there maybe a way to scroll through each record in the dataset? Any ideas are welcome!!

thank in advance,
H. Barnes
 
You have to add a field (true/false type) in the table that holds the Invoice item lines. Then set the value of this to True for each record processed, False for not processed.

Add a check box in the subform based on the new true/false field. Now you will have a checkmark for processed or unchecked for not processed when viewed as a continuous Form, or as a value '-1' or '0' when viewed as a worksheet.

Rod
 
Is there any way to do this without creating a new field? My subform is displaying data from multiple tables. It's not really coming from one place. I'm not sure which table would be best place to add a field. I just want to be able to mark a record (maybe not with a checkbox?), then process some code behind the form if it is marked. Make sense?

thanks in advance,
H. Barnes
 
OK just place a check box in the subform. Lets call it MyChkBox. Say you want to monitor whether a field called MyAmount is greater than 200 then set the Control Source for MyChkBox to:


=iif(MyAmount > 200, True, False)


To carry out some action dependent on the state of MyChkBox place code in the on current event:


if MychkBox = True Then
action_statement
Else
alternative action_statement
End If


Rod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top