Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    tblLeave is for recording user absences? tblLeave should have a field for UserID, not Username. Then filter the records when form opens as described in post 6.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    tblLeave is for recording user absences? tblLeave should have a field for UserID, not Username. Then filter the records when form opens as described in post 6.
    hmmm how to say... i'm attached with my latest progress.. tblLeave is for store leave that apply by employee.. as i think that 1 employee might have many leave right? What i have in FormApplyLeave is include all the attribute of the tblLeave and inside the tblLeave there is foreign key called UserID that linked to tblUsers that is known as employee.. When employee apply for the leave the FormApplyLeave is appeared.. What i want to do is when employee fill up the leave field, its possible make the UserID text box is auto detect or auto filled based on which user login?Database3.zip

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The ApplyLeave button is opening frmViewDetail. Should that be opening frmApplyLeave? Why would you need code to set UserID of frmViewDetail? Why use DLookup when the UserID is already available on frmMainEmployee?

    Need to close formMainEmployee or don't set it as Popup & Modal.
    DoCmd.OpenForm "frmApplyLeave", , , "UserID=" & Me.fldLoginID, , , Me.fldLoginID
    DoCmd.Close acForm, frmMainEmployee, acSaveNoCode

    Code behind frmApplyLeave to move to new record and set the UserID.
    Private Sub Form_Load()
    DoCmd.GoToRecord , , acNewRec
    Me.UserID = Me.OpenArgs
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Quote Originally Posted by June7 View Post
    The ApplyLeave button is opening frmViewDetail. Should that be opening frmApplyLeave? Why would you need code to set UserID of frmViewDetail? Why use DLookup when the UserID is already available on frmMainEmployee? Need to close formMainEmployee or don't set it as Popup & Modal. DoCmd.OpenForm "frmApplyLeave", , , "UserID=" & Me.fldLoginID, , , Me.fldLoginID DoCmd.Close acForm, frmMainEmployee, acSaveNoCode Code behind frmApplyLeave to move to new record and set the UserID. Private Sub Form_Load() DoCmd.GoToRecord , , acNewRec Me.UserID = Me.OpenArgs End Sub
    err wait a sec what does ", , ," mean? >>DoCmd.OpenForm "frmApplyLeave", , , "UserID=" & Me.fldLoginID .. the parameter make me confuse..

  5. #20
    aquilina is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    11
    Orite im good to go.. thank again.. i will continue this thread until i finish up just left few things.. when we apply leave, the textbox in FrmApplyLeave will automatically set the ID and userID and it directly saved in tblLeave.. any command that make it appear in textbox but it didnt added in tblLEave? Until i press Add button it will automatically add the LeaveID and UserID in tblLeave

  6. #21
    sherrysansone is offline Novice
    Windows 2K Access 2000
    Join Date
    May 2014
    Posts
    1
    you have to do admin because its have all functionality..

    read this
    Last edited by sherrysansone; 05-17-2014 at 12:18 AM.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 11-07-2013, 04:02 PM
  2. Replies: 9
    Last Post: 10-14-2013, 02:23 PM
  3. Replies: 7
    Last Post: 07-02-2012, 10:50 PM
  4. Replies: 2
    Last Post: 05-11-2011, 02:58 PM
  5. Show only current record in report from form/subform
    By stelioshania in forum Reports
    Replies: 0
    Last Post: 03-02-2011, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums