Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 50

Thread: Time Clock

  1. #21
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Can you give more details? Do you mean a key pressed in the tree grid?

    Regards,


    Yvonne

  2. #22
    Hi Yvonne

    I have a Field that i send the focus to, to handle the timeclock "type 1-4" keyboard input (Changed Delegate). if they hit 1 thru 4 i send the focus to the appropriate commandbutton 1-4 to handle posting the punch to the data file(s)(GotFocus). i would like to be able to hit "ESC-Chr(27)) key if they don't want to commit to the data update and send the focus back to the "badge" field. I tried Lastkeey() in the Interactive Delegate but it doesn't work correctly.
    I appreciate your help.

    Glen

  3. #23
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Glen,

    Create a Hotkey delegate for the containing Section and check for 'Esc'.

    https://www.lianja.com/doc/index.php...legates#Hotkey

    Regards,

    Yvonne

  4. #24
    Hi Yvonne

    Thank you for the help. i will have may apps that have many fields on one section that will perform differnent commands based on the keypressed while in that field. I'm not sure how that will work with a section based HotKey.

  5. #25
    Hello

    Since i am brand new to Lianja could you please tell me if these database connection look correct. they seem to work.

    Tables in Database: butchery
    Name Path Type
    ------------------- ------------------------------------------------------------ --------------------
    + vt_company C:\Lianja\data\butchery\vt_company.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=F:\fox\data\Company.dbf;Exclusive=No'
    | alias 'VT_COMPANY'
    | primarykey 'compid'
    | as select * from company where status="A"
    + vt_employee C:\Lianja\data\butchery\vt_employee.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=F:\fox\data\Employee.dbf;Exclusive=No'
    | alias 'vt_employee'
    | primarykey 'badge,Empid'
    | as select * from Employee where act_stat=.T.
    + vt_localpunch C:\Lianja\data\butchery\vt_localpunch.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=F:\timeclock\data\localpunch.dbf;Exclusive= No'
    | alias 'vt_localpunch'
    | basetable 'F:\timeclock\data\localpunch.dbf'
    | primarykey 'compid+DTOS(datetime)'
    | as select * from localpunch where datetime=>date()-30
    + vt_paypunch C:\Lianja\data\butchery\vt_paypunch.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=F:\fox\data\PayPunch.dbf;Exclusive=No'
    | alias 'vt_paypunch'
    | basetable 'F:\fox\data\PayPunch.dbf'
    | primarykey 'compid+DTOS(datetime)'
    | as select * from PayPunch where datetime=>date()-30
    + vt_timetype C:\Lianja\data\butchery\vt_timetype.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=F:\Fox\data\TimeType.dbf;Exclusive=No'
    | alias 'vt_timetype'
    | primarykey 'Type'
    | as select * from TimeType
    + info C:\Lianja\data\butchery\info.dbf VirtualTable
    | connstr 'oledb:Provider=VFPOLEDB;Mode=Share Deny None;Data Source=C:\CSP\TimeClock\data\Info.DBF;Exclusive=No '
    | alias 'Info'
    | primarykey 'Compid'
    | as Select * from Info

  6. #26
    Hello
    I am asking about the virtual table connections because i have the following issue.
    I run the following code:
    if !used([VT_TimeType])
    Use Butchery!VT_TimeType in 0 shared
    Endif
    if !used([VT_LocalPunch])
    use Butchery!vt_localpunch in 0 shared
    Endif
    if !used([VT_PayPunch])
    use Butchery!vt_Paypunch in 0 shared
    Endif
    fields(6).addItems("select substr(ttoc(vt_LocalPunch.datetime),12,11) as Time,Type,VT_TimeType.Label from Butchery!VT_LocalPunch Inner Join Butchery!VT_TimeType on VT_LocalPunch.Type=VT_TimeType.Type where vt_LocalPunch.Badge='"+fields(5).text+"' and ttod(Datetime)=Date() order by datetime desc")

    And the data presents in the correct Datetime sorted order

    I run:
    if !used([VT_TimeType])
    Use Butchery!VT_TimeType in 0 shared
    Endif
    if !used([VT_LocalPunch])
    use Butchery!vt_localpunch in 0 shared
    Endif
    if !used([VT_PayPunch])
    use Butchery!vt_Paypunch in 0 shared
    Endif
    Fields(6).AddItems("Select substr(ttoc(VT_Paypunch.datetime),12,11) as Time,VT_PayPunch.Type,VT_TimeType.Label from Butchery!VT_PayPunch Inner Join Butchery!VT_TimeType On VT_PayPunch.Type=VT_TimeType.Type where vt_PayPunch.Badge='"+fields(5).text+"' and ttod(Datetime)=Date() order by Datetime Desc")
    And teh data doe not sort correctly.

  7. #27
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Quote Originally Posted by TheButcheryInc View Post
    Hi Yvonne

    Thank you for the help. i will have may apps that have many fields on one section that will perform differnent commands based on the keypressed while in that field. I'm not sure how that will work with a section based HotKey.
    Hi Glen,

    Use the section Hotkey to handle the 'Esc' - it should just return if the parameter passed is not 'Esc'. Individual fields can use Interactive Change or Hotkey depending on the other keys you want to trap.

    Regards,

    Yvonne

  8. #28
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Glen,

    Try running the SQL Select in the command window / Console and check the results. You can also try with just the single table and order. Also the explain command or set explain on give information about a SQL Select.

    For the vt definitions, the 'basetable' should not reference the path, but that should not affect the order. I cannot immediately see anything else that would cause a problem.

    Regards,

    Yvonne

  9. #29
    Hi Yvonne
    It works correctly in the console. I will fix the Basetable. Should the KEYFIELD be an index name on the orinating Foxpro table ?
    It is interesting that the same table structure in one location works and the other does not. I will try to bypass the issue by creating an intermediate sql table in the correct order and AddItems from that.
    Thank you very much for your time and help.
    Glen

  10. #30
    Hi Yvonne

    It appears that you cannot sort on Substr of a field. I am going to use the Datetime field alone and it works.
    Thanks again.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us