need a way to control number of lines in a section

Ziggy1

Registered User.
Local time
Today, 09:24
Joined
Feb 6, 2002
Messages
462
I have a report that serves as a receiving form for the warehouse, we know all the "Expected" info, so I have all the header and product details filled in.

The Warehouse needs to manually write down where they put the stock, so I place X number of empty text boxes to form a grid for them to write into.

Problem: If it is a full load of one item it is not an issue, but with a mixed load there is less locations per product, I don't want to over complicate it but how might I be able to control how many rows or text boxes to display per product.

* to keep it simple a hard coded value can be used in an example of code. I'm just not sure where to start.

Thanks
 
I am using just a rectangle shape, sorry it is not a control...basically if I had the report designed with one shape I want to be able to repeat printing the shape in the detail section I would want to say calculate that I need 6 boxes for the item and then have Access repeat that control 6 times.

I just had a revelation as I am typing this, I could create a subreport based on a record set that creates a detail record for every pallet required ( total divided by Pallet qty) required this would generate a control for every record even if there was data I could just make the font color white , I would set the columns to maybe 4 accross. I think this might work, I'll explain better once I work it out.
 
I like your sub report idea. Based on your explanation, I think that just might work for you.
 
FYI - I put this together and it is working, it reads the field with the qty and adds a record for each. My next step will be to make a report based on that table. and then add it as a sub report.

what I will do is make this happen when I run the report and do the update only for the selected receipt and the delete the data when done since I don't want to store this info. I think it will work good. I need to put this aside for a few days as something else takes precedence but I'm looking forward to get it together. I'll try and post a finished sample later.

thanks for replying, I'm pretty sure just reading those links you provided got the marbles rolling :) And if there is a better way, I'm open to that as well.


Code:
Private Sub Command1_Click()

Dim rs As DAO.Recordset
Dim mySQL As String
Dim X As Integer
  
Set rs = CurrentDb.OpenRecordset("qryIntransitLotted_ALL-Pallets2")
  
With rs
  
Do Until .EOF
  
  If rs!SkusPerStgUnit <> "" Then
  
  For X = 1 To rs!SkusPerStgUnit
  
  'MsgBox rs!SkusPerStgUnit
  
  mySQL = "INSERT INTO tblLocationCounter (Intransit, Client, Product ) "
  mySQL = mySQL + "Values(" & rs!Intransit_Receipt_number & "," & rs!Client_Code & ",'" & rs!Product_Code & "')"
  
  ' use to check SQL syntax if causing grief :)
  'Me.txtSQL = mySQL
  
  DoCmd.SetWarnings False
        DoCmd.RunSQL mySQL
  DoCmd.SetWarnings True
  
  Next X
  
  End If
    
.MoveNext
  
Loop
  
.Close
  
End With


End Sub
 
Just a quick update....I was able to figure it out with the scenario mentioned above.

I create a temp table that creates a record for every pallet, I added some dummy fields to the table and use them on the Subreport. you can see the subreport on it's own is not much use but when linked in the Main report will only return the number related to the record. I think it works pretty good.

I don't have time to make a sample but I'll try and do that later...if anyone reading this at a later date is looking for the same thing, just reply to this post and I will help.
 

Attachments

  • ScreenShot_013.jpg
    ScreenShot_013.jpg
    56.8 KB · Views: 129
  • ScreenShot_015.jpg
    ScreenShot_015.jpg
    70.8 KB · Views: 153
  • ScreenShot_016.jpg
    ScreenShot_016.jpg
    58.7 KB · Views: 117

Users who are viewing this thread

Back
Top Bottom