Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2003
    Posts
    22

    Angry Unanswered: Making Labels Part 2 PLZ HELP

    I thought I had this thing figured out! It works perfectly, all I need it to do now is print!!!! For some reason in only prints the last two entries, they show up fine in the preview but they dont show up when you print them. If you dont want to waste paper you can use the publish with Microsoft word button on the print preview window to see what im talking about. I dont know what is going on here....



    PS.
    This database is just suppose to ask the user for stopping and ending values, then print them out in a report in two columns, so I can use it to print my labels.
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2003
    Posts
    22

    Question

    I think it is happing because the values aren't being stored any where, just overwriten then displayed again, i dont understand why it doesnt print right though...

  3. #3
    Join Date
    Jun 2003
    Posts
    22
    Heres the code BTW:

    -----------------------------------------------------------------------

    Dim intStart As Integer
    Dim intStop As Integer
    Dim intRightStart As Integer

    ----------------------------------------

    Private Sub Report_Open(Cancel As Integer)
    On Error GoTo ErrCode

    Dim strMsg As String

    '' Asks the user for the starting and stopping asset ID's

    strMsg = "Enter your starting asset ID"
    intStart = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    strMsg = "Enter the ending asset ID"
    intStop = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    '' Make sure ending value is greater then starting value

    If intStart >= intStop Then
    Cancel = True
    MsgBox "Your ending value can't be less then your starting value!"
    Exit Sub
    End If

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    ----------------------------------------

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo ErrCode

    '' I named TextBox LeftValue and RightValue

    intRightStart = intStart + 1
    Me.LeftValue.Value = intStart
    Me.RightValue.Value = intRightStart

    '' Ends if the current value is higher then the stopping value

    If intStart < intStop And intRightStart < intStop Then
    Me.MoveLayout = True
    Me.NextRecord = False
    End If

    ''Increasing left and right columns by 1

    intStart = intRightStart + 1
    intRightStart = intStart + 1

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    ----------------------------------------

    Private Sub Report_Page()
    On Error GoTo ErrCode

    '' For some reason the values increase by two when you go to the next page, this fixes this problem

    intStart = intStart - 2

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    ----------------------------------------

  4. #4
    Join Date
    Jun 2003
    Posts
    22

    Re: Making Labels Part 2 PLZ HELP

    Originally posted by jimslim
    I thought I had this thing figured out! It works perfectly, all I need it to do now is print!!!! For some reason in only prints the last two entries, they show up fine in the preview but they dont show up when you print them. If you dont want to waste paper you can use the publish with Microsoft word button on the print preview window to see what im talking about. I dont know what is going on here....



    PS.
    This database is just suppose to ask the user for stopping and ending values, then print them out in a report in two columns, so I can use it to print my labels.

    still not working.........

  5. #5
    Join Date
    Sep 2002
    Location
    Finland
    Posts
    34

    Re: Making Labels Part 2 PLZ HELP

    Hi,


    If you dot'n preview report and print it straight, you got rigt values.

    Access run Detail_format code when you preview and it run again when you print report.

    Therefore I edit code if you want first preview - see attached file or code.


    Option Compare Database

    Dim intStart As Integer
    Dim intStop As Integer
    'Dim intRightStart As Integer
    '' mns/20030808->
    '' Access run Detail_format code when you preview and it run again when you print report.
    '' Therefore start must save for later use.
    Dim intCurVal As Integer
    '' mns/20030808<-


    Private Sub Report_Open(Cancel As Integer)
    On Error GoTo ErrCode

    Dim strMsg As String

    '' Asks the user for the starting and stopping asset ID's

    strMsg = "Enter your starting asset ID"
    intStart = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    strMsg = "Enter the ending asset ID"
    intStop = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    '' Make sure ending value is greater then starting value
    If intStart >= intStop Then
    Cancel = True
    MsgBox "Your ending value can't be less then your starting value!"
    Exit Sub
    End If

    '' mns/20030808->
    intCurVal = intStart
    '' mns/20030808<-

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo ErrCode

    '' I named TextBox LeftValue and RightValue
    '' mns/20030808->
    'intRightStart = intStart + 1
    'Me.LeftValue.Value = intStart
    'Me.RightValue.Value = intRightStart
    Me.LeftValue.Value = intCurVal
    intCurVal = intCurVal + 1
    Me.RightValue.Value = intCurVal
    intCurVal = intCurVal + 1
    '' mns/20030808<-



    '' Ends if the current value is higher then the stopping value
    '' mns/20030808->
    'If intStart < intStop And intRightStart < intStop Then
    If intCurVal < intStop Then
    '' mns/20030808<-
    Me.MoveLayout = True
    Me.NextRecord = False
    '' mns/20030808->
    Else
    intCurVal = intStart
    '' mns/20030808<-
    End If

    ''Increasing left and right columns by 1
    '' mns/20030808->
    'intStart = intRightStart + 1
    'intRightStart = intStart + 1
    '' mns/20030808<-

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    Private Sub Report_Page()
    On Error GoTo ErrCode

    '' For some reason the values increase by two when you go to the next page,
    '' this fixes this problem
    '' mns/20030808->
    '' I have same problem, but I fix it with Detail_Retreat() section.
    '' For some reason Detail_Retreat not work with your report.
    '' mns/20030808<-

    intCurVal = intCurVal - 2

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

  6. #6
    Join Date
    Jun 2003
    Posts
    22

    Talking Re: Making Labels Part 2 PLZ HELP

    Originally posted by mns
    Hi,


    If you dot'n preview report and print it straight, you got rigt values.

    Access run Detail_format code when you preview and it run again when you print report.

    Therefore I edit code if you want first preview - see attached file or code.


    Option Compare Database

    Dim intStart As Integer
    Dim intStop As Integer
    'Dim intRightStart As Integer
    '' mns/20030808->
    '' Access run Detail_format code when you preview and it run again when you print report.
    '' Therefore start must save for later use.
    Dim intCurVal As Integer
    '' mns/20030808<-


    Private Sub Report_Open(Cancel As Integer)
    On Error GoTo ErrCode

    Dim strMsg As String

    '' Asks the user for the starting and stopping asset ID's

    strMsg = "Enter your starting asset ID"
    intStart = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    strMsg = "Enter the ending asset ID"
    intStop = InputBox(Prompt:=strMsg, _
    Title:="User Info", XPos:=2000, YPos:=2000)

    '' Make sure ending value is greater then starting value
    If intStart >= intStop Then
    Cancel = True
    MsgBox "Your ending value can't be less then your starting value!"
    Exit Sub
    End If

    '' mns/20030808->
    intCurVal = intStart
    '' mns/20030808<-

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo ErrCode

    '' I named TextBox LeftValue and RightValue
    '' mns/20030808->
    'intRightStart = intStart + 1
    'Me.LeftValue.Value = intStart
    'Me.RightValue.Value = intRightStart
    Me.LeftValue.Value = intCurVal
    intCurVal = intCurVal + 1
    Me.RightValue.Value = intCurVal
    intCurVal = intCurVal + 1
    '' mns/20030808<-



    '' Ends if the current value is higher then the stopping value
    '' mns/20030808->
    'If intStart < intStop And intRightStart < intStop Then
    If intCurVal < intStop Then
    '' mns/20030808<-
    Me.MoveLayout = True
    Me.NextRecord = False
    '' mns/20030808->
    Else
    intCurVal = intStart
    '' mns/20030808<-
    End If

    ''Increasing left and right columns by 1
    '' mns/20030808->
    'intStart = intRightStart + 1
    'intRightStart = intStart + 1
    '' mns/20030808<-

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub

    Private Sub Report_Page()
    On Error GoTo ErrCode

    '' For some reason the values increase by two when you go to the next page,
    '' this fixes this problem
    '' mns/20030808->
    '' I have same problem, but I fix it with Detail_Retreat() section.
    '' For some reason Detail_Retreat not work with your report.
    '' mns/20030808<-

    intCurVal = intCurVal - 2

    ExitCode:
    Exit Sub

    ErrCode:
    MsgBox Err.Description
    Resume ExitCode

    End Sub
    Your the man, Got it working finally - I was about to give up and just use a seperate app to print labels, but now it is integrated into my database.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •