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

using checkbox to create record

Status
Not open for further replies.

handlebarry

Technical User
Dec 21, 2004
118
GB
I need to create a form that links one record in tbl-contracts to several records in tbl-appartments. I was going to do this with a third table (table x) that lists contract codes against apparment codes.

I have a subform that shows appartments with a checkbox next to each record. The idea being that a user chooses which apparments are linked to a particular code with the checkboxes.

However the subform has a query as record source. There is nothing to link the checkbox to. Would the only solution be for the query create a tempory table (with an extra check box field) and then use this temp table to create records in table X?


hope this makes sense
thanks in advance
 
If you want to go that route create a boolean field in tbl-Apartments that you can link the checkbox to, you can then iterate trough all the selected records, add the related record to table X, then clear this field. If you have concurrent users this can cause unexpected results (if more than one user is checking apartments to link to contracts).

Another possible route is use a list box for the apartments, you can then turn the multi-select on which will allow users to select more than one appartment ([tt]<CTRL> mouse click[/tt]) and then you can iterate through the Items Selected of the list box to add your related records to table X.

Hope this helps,
CMP

A little salt for my response, I hate temporary tables! They cause database bloat and in my opinion are never a good idea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top