Futures_Bright
Registered User.
- Local time
- Today, 08:14
- Joined
- Feb 4, 2013
- Messages
- 69
Hi all,
I originally used a 'multi-valued combobox' to store applicability but ran into a headache or two (!) trying to get it to work.
As a result I'm now using a table with a 1-1 relationship to record yes/no values for each type of company/particular time each record in the parent table will apply. The relationship is between [Applicability].[RelClauseID] and [QMS Clause].[Clause ID] where the latter is a primary key.
Hopefully that gives enough of a background to the new setup, now what I'm looking to do is make the results far more easy to read; the way I intend on doing this is writing all values for that record which are 'True' in an unbound Text box. Cycling through the fields in a table is where I am coming a bit stuck - I believe I want some code along the lines of below:
Any suggestions how best to do this? There are two fields in the table which aren't Yes/No (Number and Autonumber) - will these be read as True, False or Null? I plan on putting a counter for False values in - if none (or 2 if the other two fields are regarded as 'False') then the textbox will just read "All".
Thanks in advance for your help.
Kind regards,
Michael
I originally used a 'multi-valued combobox' to store applicability but ran into a headache or two (!) trying to get it to work.
As a result I'm now using a table with a 1-1 relationship to record yes/no values for each type of company/particular time each record in the parent table will apply. The relationship is between [Applicability].[RelClauseID] and [QMS Clause].[Clause ID] where the latter is a primary key.
Hopefully that gives enough of a background to the new setup, now what I'm looking to do is make the results far more easy to read; the way I intend on doing this is writing all values for that record which are 'True' in an unbound Text box. Cycling through the fields in a table is where I am coming a bit stuck - I believe I want some code along the lines of below:
Code:
Dim strFieldName as String, strAppResult as String
For each [COLOR="Red"]field[/COLOR] in [Applicability]
If dlookup("" & strFieldName & "", "[Applicability]", "[Applicability].[Related Clause] = Me.[Clause ID]") = True then
[COLOR="red"]'append to strAppResult[/COLOR]: ", " & strFieldName & ""
Else
End If
next [COLOR="red"]field[/COLOR]
Any suggestions how best to do this? There are two fields in the table which aren't Yes/No (Number and Autonumber) - will these be read as True, False or Null? I plan on putting a counter for False values in - if none (or 2 if the other two fields are regarded as 'False') then the textbox will just read "All".
Thanks in advance for your help.
Kind regards,
Michael
Last edited: