02. august 2001 - 22:09Der er
13 kommentarer og 1 løsning
Et Program til Avisbundter/Etiketter
Jeg har modtaget et regne ark som indeholder rutenr.(Kolonne A) og bundt str.(Kolonne B)
A B 100 28 101 100 101 56 102 100 102 100 102 78 104 100 104 32
Der udregnet bundter på basis af der må Maks. være 100 stk. aviser i hvert bundt. Dvs Eks.: Rutenr 104 skal have 132 stk. ( 1 bdt.á 100 stk + 1 bdt. á 32 stk.
Jeg vil gerne have hjælp til at finde det Totale antal aviser pr rutenr.
EKS.:
A B 100 28 101 156 102 278 104 132
Hver anden uge er der reklamer indelagt i avisen, så må der ikke være 100 stk. pr. bundt , da det bliver for tungt.
Til dette formål vil jeg gerne lave bundterne om til 75 eller måske 50 stk. pr. bundt. Så skal jeg jo lave en division på basis af det totale antal aviser pr. Rutenr.
Jeg tror du skal starte forfra og lave en tabel med alle ruter og sumaviser. Ud fra denne tabel kan du så lave dine beregninger med hhv. 100, 75, 50 aviser pr bundt.
hi pejsen You need to first link the Excel table to Access.
This can be done from the File+Get External Data+Link Tables menu. Choose Microsoft Excel from the Files of Type list. Then find the Excel file you want to use and follow the instructions. Once this is done you should have access to the Excel sheet through Access.
Now you can make a query to see the data as you wish. This is an example you could use. This query askes you for the maximum number of \"aviser\" which should be in a \"bundt\". It also shows you the number of FULL \"bunter\" and how many are in the last \"bund\"!
What more do you need? Dont tell me, you have never used Access! If thats the case then you can send me the Excel file and let me knoiw which version of Access you are using!
SELECT tblAviser.rutenr, Sum(tblAviser.bundtstr) AS Total, ([Total]-([Total] Mod [Str]))/[Str] AS Full, [Total] Mod [Str] AS rest FROM tblAviser GROUP BY tblAviser.rutenr;
Det er rigtigt at jeg er \"Beginner\", men jeg har fået oprettet forespørgelsen.
Og den viser Med Bundtstr. på 100 stk
Navn Total Full rest 101 130 1 30 102 195 1 95 103 100 1 0 104 37 0 37 105 110 1 10 106 170 1 70
Det jeg ikke kan finde ud af er at få det ud på etiketter Der kommer til at se forkert ud det skal se således ud -------- 101 100 stk -------- 101 30 stk -------- 102 100 stk -------- 102 95 stk -------- 103 100 stk -------- 104 37 stk -------- 105 100 stk -------- 105 10 stk -------- 106 100 stk -------- 106 70 stk ------- etc. ------- etc. ------- etc.
I dont think it as anything to do with you using Dansk Access. I think you need to choose Sheet Feed instead of continuous under LABEL TYPE. Just play around with it and you will get there, or send me the dB and I will look at it. dkTeBrSa@europe.lego.com
pejsen> I think it sgoing to take a bit of programming, so I think it would be best if you sent me the database. It will be much quicker than me trying to explain what and where to put the code.
dktebrsa@europe.lego.com (the .com) may have been removed from the hyperlink!
For those interested: A form with a single field for entering max bundt størrelse. Button on form to open report(label wizard) which uses a temp table which gets its data from the following.
Private Sub cmdLabel_Click() Dim db As Database Dim rst As Recordset Dim sSQL As String
On Error GoTo Err_cmdLabel_Click
Dim stDocName As String Dim lCnt As Long
sSQL = \"SELECT tblAviser.Navn AS Route, tblAviser.[Postnummer og by], Sum(tblAviser.Antal) AS Total, \" sSQL = sSQL & CLng(Me.txtAntal) sSQL = sSQL & \" AS MaxBundt, ([Total]-([Total] Mod [MaxBundt]))/[MaxBundt] AS [Full], [Total] Mod [MaxBundt] AS rest\" sSQL = sSQL & \" FROM tblAviser\" sSQL = sSQL & \" GROUP BY tblAviser.Navn, tblAviser.[Postnummer og by];\"
Set db = CurrentDb Set rst = db.OpenRecordset(sSQL)
DoCmd.SetWarnings False
DoCmd.RunSQL \"DELETE * FROM tblToLabel\"
Do Until rst.EOF \'Only if there are papers! If rst!full > 0 Or rst!rest > 0 Then lCnt = rst!full
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.