Another Form/Subform problem

  • Thread starter Thread starter bolanddj
  • Start date Start date
B

bolanddj

Guest
Hello all... I am having a form/subform issue. I'm working on a project involving handling orders, and am using a mainform to handle displaying the pertinent mailing/total pricing information. A subform is used to track items associated with the order. The issue I am running into is that I've limited the subform's size to 5 items in both screen and print views because I'm using a capture of the currently used paper form that only allows that number. However, orders can contain more items, and I want to be able to print those, which I can't do right now. My hope would be to print the form multiple times with the mainform data the same as many times as necessary to capture all the subform entries. Is there a way to do this?

While I realize that the ideal printing solution is a report, this option is providing its own problems in that much of the form population is handled by queries that do not have the same syntax when dealt with in reports (can't fetch user's name by querying a userID because all data in report is generated at once, as opposed to a form where data is fetched when it is needed). The reports have proven very difficult to use and I would like to avoid them if possible for this aspect of the project.

I would appreciate any help you might be able to give me. Thanks...
 
Report:

You can based the recordset of the form on a query wherein the userid is linked to the current recordset of the form.

Form:

Have you tried can grow and can shrink?

If that doesnt work, you can create a code, wherein you count the rows iof that recordset first, then set the form height on a computation.

This is what i did on my project, I got three subforms that adds rows of data. so on every update, i call this sub.

I know you'll get idea.




Sub ReformatAllHeight()
'MsgBox "inside ReformatAllHeight"
HeightLabelAll = 0.2813 * 1441
RunningHeight = HeightLabelAll + 500

'LeftAll = 0.1979 * 1441 ' .1979 is what you will see in the property boxes
'WidthAll = 7.5313 * 1441 ' old values

LeftAll = 0.6146 * 1441
WidthAll = 7.6563 * 1441
TopLabel1 = 0.0833 * 1441

TopText1 = TopLabel1 + HeightLabelAll ' + 250
'RunningHeight = RunningHeight + NoteFormHeight '+ 250
RunningHeight = RunningHeight + WarnFormHeight '+ 250

TopLabel2 = (TopText1 + NoteFormHeight) '* 1441
RunningHeight = RunningHeight + HeightLabelAll

TopText2 = TopLabel2 + HeightLabelAll '+ 250
'RunningHeight = RunningHeight + CautFormHeight '+ 250
RunningHeight = RunningHeight + CautFormHeight '+ 250

TopLabel3 = (TopText2 + CautFormHeight) '* 1441
RunningHeight = RunningHeight + HeightLabelAll

TopText3 = TopLabel3 + HeightLabelAll '+ 250

RunningHeight = RunningHeight + NoteFormHeight '+ 250

Me.FormHeader.Height = RunningHeight
Me.Form.Refresh

Me.AtoWarn_Subform_Label.Top = TopLabel1
Me.AtoWarn_Subform_Label.Height = HeightLabelAll
Me.AtoWarn_Subform_Label.Left = LeftAll
Me.AtoWarn_Subform_Label.Width = WidthAll

Me.AtoWarn_Subform.Top = TopText1
Me.AtoWarn_Subform.Height = WarnFormHeight
Me.AtoWarn_Subform.Left = LeftAll
Me.AtoWarn_Subform.Width = WidthAll

Me.AtoCaut_Subform_Label.Top = TopLabel2
Me.AtoCaut_Subform_Label.Height = HeightLabelAll
Me.AtoCaut_Subform_Label.Left = LeftAll
Me.AtoCaut_Subform_Label.Width = WidthAll

Me.AtoCaut_Subform.Top = TopText2
Me.AtoCaut_Subform.Height = CautFormHeight
Me.AtoCaut_Subform.Left = LeftAll
Me.AtoCaut_Subform.Width = WidthAll

Me.AtoNote_subform_Label.Top = TopLabel3
Me.AtoNote_subform_Label.Height = HeightLabelAll
Me.AtoNote_subform_Label.Left = LeftAll
Me.AtoNote_subform_Label.Width = WidthAll

Me.AtoNote_subform.Top = TopText3
Me.AtoNote_subform.Height = NoteFormHeight
Me.AtoNote_subform.Left = LeftAll
Me.AtoNote_subform.Width = WidthAll
Me.Form.Refresh





End Sub
 
Just my 2cents here ;)

I would do the a printed report with as many items as there are in the order, not 5 per page (unless that's all you can ever squeeze on a page - then let the report figure that pc out).

a. Get past the 5/page issue as I would think it'd be more efficient anyway...
b. Figure out why the printed version will not work... Seems you have to cross this bridge in time and it'll be a great learning opportunity....

IMHO :)
 

Users who are viewing this thread

Back
Top Bottom