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

Omitting like values in detail section of a MSAccess report

Status
Not open for further replies.

petek

Technical User
Jan 19, 2002
2
US
Example of problem

Presently looks like this

BRAND OF DRUG
Esomeprazole Nexium Tablet 20mg
Licensed for:
Gastro-oesophageal reflux disease
Duodenal or gastric ulcer

BRAND OF DRUG
Esomeprazole Nexium Tablet 40mg
Licensed for:
Gastro-oesophageal reflux disease
Duodenal or gastric ulcer

(Because I set up the RDBMS so that 'licensed for' were listed under the generic name of the drug (esomprazole)these are repeated for every different strength of the same formulation of the same drug. Ideally what I would like to do is produce the following report

BRAND OF DRUG
Esomeprazole Nexium Tablet 20, 40mg
Licensed for:
Gastro-oesophageal reflux disease
Duodenal or gastric ulcer

Thus listing both strengths and the indications once only. Due to the grouping features etc I don't seem to be able to achieve this. I think what I am going to have to do is produce a procedure which is called from OnFormat when a group (such as esomeprazole, nexium capsules) is about to be formatted for printing

Any bright ideas??
 
petak,
You could group by the field value that's duplicate, and instead of showing the detail, make it invisible, but in the detail format build a report-scoped variable that concat's each detail records size, ie
Sub Detail_OnFormat()
m_strTemp = m_strTemp & me.size & ","
End Sub

Then in the Group footer,(which is effectively your 'detail' section now--since you're suppressing detail by setting .visible to No), you put this in the ONFormat of GroupFooter:
'(put some code to strip the trailing comma first)
me.txtSize = m_strTemp
m_strTemp = "" 'clear for next group


I'm not sure what your field name's are, but you should get the idea here. Additionally, you can also count the # of dups, and put a field that has that, using the Count() in the controlsource of the field.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top