GK in the UK
Registered User.
- Local time
- Today, 11:55
- Joined
- Dec 20, 2017
- Messages
- 281
Related to my last question https://www.access-programmers.co.uk/forums/showthread.php?t=309030
I have a SQL query which has an IIF which sets a form checkbox according to whether a record exists in a table. Like this:
IIf(([tblTransLines].[TransLineID]=[tblSelectLines].[SelectLinesID]),True,False) AS Selected
The query was built in design view and the SQL copied into the RecordSource in the form code - largely because I need to specify a parameter and I haven't yet found a way to get the parameter into the query but that's a separate issue.
I put some records in to tblSelectLines, PK same as the records that I want to see checked, and it's all working.
The checkbox is displayed correctly but it's not updateable.
I put a second checkbox on the form and set the datasource to: =[Selected]. It still won't update (duh)
I removed the datasource completely and now I can click it and AfterUpdate fires (no use at all of course)
This is what's meant to happen:
When the check box is checked, it inserts a single record into tblSelectLines.
When the check box is unchecked, it deletes that same single record.
Is there a workaround for this ?
I have a SQL query which has an IIF which sets a form checkbox according to whether a record exists in a table. Like this:
IIf(([tblTransLines].[TransLineID]=[tblSelectLines].[SelectLinesID]),True,False) AS Selected
The query was built in design view and the SQL copied into the RecordSource in the form code - largely because I need to specify a parameter and I haven't yet found a way to get the parameter into the query but that's a separate issue.
I put some records in to tblSelectLines, PK same as the records that I want to see checked, and it's all working.
The checkbox is displayed correctly but it's not updateable.
I put a second checkbox on the form and set the datasource to: =[Selected]. It still won't update (duh)
I removed the datasource completely and now I can click it and AfterUpdate fires (no use at all of course)
This is what's meant to happen:
When the check box is checked, it inserts a single record into tblSelectLines.
When the check box is unchecked, it deletes that same single record.
Is there a workaround for this ?