select a month
Moderator: Rathinagiri
select a month
Hi friends,
I'm working on a prog that prints the monthly salary a driver gets as a receipt. So,the month and year has to be set. For selecting the month I think a grid with the names of the 12 months would be the appropriate tool, the year should be typed in a textbox, with the current year as default.
Would you agree or is there a better choice?
TIA
Robert
I'm working on a prog that prints the monthly salary a driver gets as a receipt. So,the month and year has to be set. For selecting the month I think a grid with the names of the 12 months would be the appropriate tool, the year should be typed in a textbox, with the current year as default.
Would you agree or is there a better choice?
TIA
Robert
Re: select a month
Listbox should be better and easier to select month
Re: select a month
I have a browse procedure I send parameters to so I can search on the temporary index key.
Browse is faster then grid for larger files.
Browse is faster then grid for larger files.
All The Best,
Franco
Canada
Franco
Canada
Re: select a month
@ mol:
I tried listbox, but I didn't find a way how to assign the selected month to variable cMon. As value I was always given the Item number.So, should I refer to that number in the array?
Thx for answering.
@Franco:
thx for your reply,
I have heard the weakness of GRID with huge files but 12 entries in a grid just work fine.
Robert
I tried listbox, but I didn't find a way how to assign the selected month to variable cMon. As value I was always given the Item number.So, should I refer to that number in the array?
Thx for answering.
@Franco:
thx for your reply,
I have heard the weakness of GRID with huge files but 12 entries in a grid just work fine.
Robert
- dragancesu
- Posts: 920
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: select a month
Try with DATE field, if you have date it's simple extract day, month or year
Re: select a month
@ dragan
the default year is the current year, so I extract:
cYear:=left(dtos(date()),4)
Can be changed by the user,of course
But concerning months the user should be able to have the choice of all 12 months.Meantime my grid is working correctly.
Thank you for all replies
Robert
the default year is the current year, so I extract:
cYear:=left(dtos(date()),4)
Can be changed by the user,of course
But concerning months the user should be able to have the choice of all 12 months.Meantime my grid is working correctly.
Thank you for all replies
Robert
- AUGE_OHR
- Posts: 2060
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: select a month
hi,
it doesn't matter if you use a Listbox or a GRID ( Browse IS a GRID ) but my Question is about "Name of Month"
the German Name is different from US Name or Chinese Name for Month but i like to use what used OS give me.
so how to do it with harbour / HMG
it doesn't matter if you use a Listbox or a GRID ( Browse IS a GRID ) but my Question is about "Name of Month"
the German Name is different from US Name or Chinese Name for Month but i like to use what used OS give me.
so how to do it with harbour / HMG
have fun
Jimmy
Jimmy
- dragancesu
- Posts: 920
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: select a month
Control with SPINNER?
Re: select a month
If you want to get selected item of listbox (I think you want month's name) you can use listbox.displayvalue
Re: select a month
Not sure what you are looking for but for selecting date between 2 dates This is what I use.
I define 2 datepickers on my form
datepicker date_1 has start value of date() - day(date())+1
datepicker date_2 has value of date()
to start these dates are all days of current month but can be set from here to what you want.
you will know what table and so select it
Then I use index on a field for a dateintable > date_1-1 and dateintable < date_2 +1 and employee = emplyeecode to temp
This creates an index that only has the records from the table you want.
Also you could then create a second index for table month = tabledatemonth.
Then you can show them in a grid. browse, or listbox. Then delete temp indexs.
I define 2 datepickers on my form
datepicker date_1 has start value of date() - day(date())+1
datepicker date_2 has value of date()
to start these dates are all days of current month but can be set from here to what you want.
you will know what table and so select it
Then I use index on a field for a dateintable > date_1-1 and dateintable < date_2 +1 and employee = emplyeecode to temp
This creates an index that only has the records from the table you want.
Also you could then create a second index for table month = tabledatemonth.
Then you can show them in a grid. browse, or listbox. Then delete temp indexs.
All The Best,
Franco
Canada
Franco
Canada