Page 2 of 2

Re: Hello world on a report

Posted: Saturday 25th January 2020 8:53am
by stevedee
grayghost4 wrote: Saturday 25th January 2020 2:42am ...If I just take your code and use it ... I have not learned anything ... I have to use your suggestion and implement them myself...
Yes, that's definitely the right attitude.

Re: Hello world on a report

Posted: Wednesday 29th January 2020 4:48am
by grayghost4
I have not been able to do what I wanted with the report module.

But with your help I have been able to finish my check program and in the process learn a lot :)

I have posted the program again for comments and maybe someone else will learn some of the things I learned.

Thanks again to those that help !

Re: Hello world on a report

Posted: Wednesday 29th January 2020 6:37pm
by cogier
Several things you could consider.

In the program the comma is a problem as you are using it as a Split Separator, consider saving with NewLines or my favourite character for this sort of thing "`". It's on the left of the "1" key on your keyboard, I have no idea what it is designed for. So now no need to worry about commas. :D

Code: Select all

Samplebankofamerica,Mrs. Jone Smith ,1234 Main Street      (555)123-7654,Home Town  State  Zipcode,0789000231,084332167,bankofamerica.jpg,23459
becomes

Code: Select all

Samplebankofamerica`Mrs. Jone Smith `1234 Main Street      (555)123-7654`Home Town  State  Zipcode`0789000231`084332167`bankofamerica.jpg`23459
Then use Split(Text,"`") to get your data.

If you have a load of TextBoxes, as in this case, you can give then the same Group name e.g. AllTextBoxes. This means that an event on any of the TextBoxes will be directed to one routine e.g. AllTextBoxes_Change(). You can use the Last keyword which holds all the data of the TextBox last used. Have a look at the 8 routines I have reduced to 1 in the attached.

You could use a ValueBox that only takes numbers and make the other change above and you could remove that routine as well. :D
printchecksBk_CO.tar.gz
(214.1 KiB) Downloaded 346 times

Re: Hello world on a report

Posted: Wednesday 29th January 2020 9:57pm
by grayghost4
thank you cogier for the feedback I was trying to find a separator that work and the accent mark look good.
Also thanks for the hint to the use of the Group uses , but I have assinged just the number fields to "NumberBoxes" and I like the code below , I think it is easer to read and self explanatory.
Public Sub NumberBoxes_keypress()  
  
  If IsDigit(Key.text) Then
  Else If key.Code = key.BackSpace Then  'continue allow key 
  Else If key.Code = key.Delete Then
  Else If Key.Code = Key.Left Then
  Else If Key.Code = Key.Right Then
  Else If Key.code = Key.Tab Then
  Else
    Stop Event  ' ignore all other keys 
  Endif

End
I will try switching them to value boxes. :D