26. september 2008 - 09:58Der er
9 kommentarer og 1 løsning
Højrejusterede priser i en alm. tekstboks
Hej Access eksperter! Jeg skal udfylde en tekstboks ud fra nogle kriterier, som brugeren har valgt i et par kombinationsbokse. Tekstboksen er bundet til et tabelfelt af datatypen "Notat", så der er god plads. Jeg udfylder tekstboxen ved hjælp af VB kode. Tekstboksen indeholder et standard tilbud bestående af forskellige "varelinier" med hver deres pris, og jeg skal så summere priserne i bunden. Det går også fint, men jeg kan ikke få priserne til at stå pænt under hinanden. Kan man lave en højrejusteret tabulator som i Word, eller bruge en tilsvarende løsning?
Because I do not see any possibility of giving the wantet choices if I generate a report.
The user should have 2 choices: 1. To copy the content from the Memobox by pressing a button 2. To Press the "Send e-mail" button which fires the command DoCmd.SendObject ....
I can not get it up and running. I tried to convert the mdb to 2003, but it did not help. If I compile the Class Module "CommonDialog" an error commes up in line: strStyle = Space(100) Compile Error: Can't find project or library. If I press OK it shows a list of available references. The name of the window is: Reference - RTF.
I think I need the Richtx32.OCX: If GetSetting("FormatteretMemo", "ActiveX", "RTF_Registered", False) = True Then Exit Function Sti = GetSpecialPath(TJ_SYSTEM) Call Shell(Sti & "\regsvr32.exe " & Sti & "\RICHTX32.OCX", WIN_NORMAL)
The following example aligns the text in the "Address" text box on the "Suppliers" form to the right. Forms("Suppliers").Controls("Address").TextAlign = 3
That did not help because I have some leading text describing the orderline which is left aligned with fixed character length, and then a price for that orderline which is right aligned. The price can have different amount of characters depending on how low or high the price is. Eksample: 100,00 = 6 characters. 1000,00 = 7 characters. Then the space between the leading text and the price differs between the different proposals.
Solution: To be sure all characters in the lines is aligned exactly beneith each other, i have choosen the font Courier as text format in the textbox. Then I wrote some code for each orderline (the following code is an example for one line).
Text_THC = Text7 Text_Final_THC = Format(Var_THC, "0.00") 'Var_THC were earlier selected in a table Len_THC = Len(Text7) Len_Final_THC = Len(Text_Final_THC) Spaces_THC = 73 - Len_THC - Len_Final_THC
Then I put in the wright amout of spaces every time.
Synes godt om
Ny brugerNybegynder
Din løsning...
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.