Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771

    What is "VBA analphabet"?

    If the worksheet is not clean enough for the import wizard, use another method for the import. Such as TransferSpreadsheet where you can specify a range. Review http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    Samuel_Silva is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    What is "VBA analphabet"? Is a Visual Basic ignorant !

    Thanks for the Tip. I will try that.

  3. #18
    Samuel_Silva is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    Since i'm a ZERO in writing code, i have thought to turnaround this problem by doing visible/invisible fields on Reports.
    In the following example, i have 3 printed labels,which are defined by "Volumes" data, and ContID which is counting and together i have the "1 of 3", "2 of 3" and "3 of 3".

    I need a conditional format to display the field identified as "A" until ContID < Volumes and the field identified as "B" will be invisible.
    Then, when ContID=Volumes, "A" is invisible and "B" will be visible.

    Click image for larger version. 

Name:	Label Example.jpg 
Views:	17 
Size:	80.1 KB 
ID:	32496


    I tried to write the code for "A" but i failed ! Here's the code:

    Private Sub CabeçalhoDoRelatório_Format(Cancel As Integer, FormatCount As Integer)
    If Me.ContID < Me.Volumes Then
    Me.Quantidade1.Visible = False
    Else
    Me.Quantidade1.Visible = True
    End If

    End Sub

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Have you tried the query I suggested? No VBA code is needed. It provides all the data needed for the label output.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    Samuel_Silva is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    My program is almost complete but some minor annoyances are yet to be solved.

    Here's what i have solved so far:
    - Quantity of labels are correct and the label "1 of ..." is working great.
    - Each report result in an independent page, so the label printer knows that its a different page and cuts the label at the end of each one. (Its a Brother label printer with a continuous roll)
    - Labels dimensions are OK.
    - Small calculator is working fine ! The mathematics for calculating Vols*Qtyn-1+QtyLastbox=Total is working OK.

    Bugs to solve:
    1.- Quantityn-1 and QuantityLasBox fields are yet to be tuned. I was using conditional formatting at it was working OK but i want to make it in VBA visible or invisible which is better since i cannot have invisible fonts on conditional formatting... (PRIORITARY)
    2.- The Math in some fields are working fine but the bound field that its supposed to store the Total in the table is not showing correctly. I have created an Unbound Field and is working 100% but it does not stores the data ....
    Updating VBA code on the bound field that its supposed to show and store the results, its being a problem form me... (PRIORITARY)
    3.- Some messages for handling errors must be tuned also. Most of it are mandatory fields that must be filled and sometimes they are not... the error masages are not clear and must be customized to be more user friendly. (NOT PRIORITARY)



    On 1. I have some code written on Reports "OnFormat" fied so you can help me.

    Info:ContID (which belongs to a Query defines the nr of reports to be shown) is a counter and is counting the Number of Volumes.

    Here are the conditions:

    Click image for larger version. 

Name:	code.JPG 
Views:	10 
Size:	58.9 KB 
ID:	32603

    Its easy to understand. Quantidade1 Always visible except on the last box. IF nr of Volumes=1 then Quantidade1 is visible since its an unique box.

    Here's the code ...but its not correct :

    Private Sub Detalhe_Format(Cancel As Integer, FormatCount As Integer)
    If Me.Volumes.Value = 1 Then
    Me.QuantidadeUltimo.Visible = False
    End If
    If Me.ContID < Me.Volumes Then
    Me.QuantidadeUltimo.Visible = False
    End If
    If Me.ContID > 1 And Me.ContID.Value = Me.Volumes Then
    Me.Quantidade1.Visible = False
    End If
    End Sub


    Thanks

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Try:

    Me.QuantidadeUltimo.Visible = Not (Me.Volumes = 1 Or Me.ContID < Me.Volumes)

    Me.Quantidade1.Visible = Not (Me.ContID > 1 And Me.ContID.Value = Me.Volumes)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    Samuel_Silva is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    19
    Thanks June7 ! It works.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-24-2017, 08:13 PM
  2. Dynamic button lables using Dlookup
    By frostnuts in forum Access
    Replies: 9
    Last Post: 03-20-2013, 10:01 AM
  3. Replies: 5
    Last Post: 12-19-2012, 09:51 AM
  4. Replies: 1
    Last Post: 10-18-2011, 07:10 PM
  5. Programming lables to hide again.
    By 95DSM in forum Programming
    Replies: 3
    Last Post: 12-30-2010, 01:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums