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
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.
What is "VBA analphabet"? Is a Visual Basic ignorant !
Thanks for the Tip. I will try that.
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.
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
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.
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:
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
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.
Thanks June7 ! It works.